Thread (6 messages) 6 messages, 2 authors, 2021-06-23

Re: [PATCH v5 1/3] ext4: add discard/zeroout flags to journal flush

From: "Theodore Ts'o" <tytso@mit.edu>
Date: 2021-06-23 01:36:44
Subsystem: filesystems (vfs and infrastructure), journalling layer for block devices (jbd2), the rest · Maintainers: Alexander Viro, Christian Brauner, "Theodore Ts'o", Jan Kara, Linus Torvalds

On Tue, May 18, 2021 at 03:13:25PM +0000, Leah Rumancik wrote:
Add a flags argument to jbd2_journal_flush to enable discarding or
zero-filling the journal blocks while flushing the journal.

Signed-off-by: Leah Rumancik <redacted>

Changes in v4:
- restructured code division between patches
- changed jbd2_journal_flush flags arg from bool to unsigned long long

Changes in v5:
- changed jbd2_journal_flush flags to unsigned int
- changed name of jbd2_journal_flush flags from JBD2_ERASE* to
JBD2_JOURNAL_FLUSH*
- cleaned up loop in jbd2_journal_erase which finds contiguous regions
- updated flag checking
---
I noticed a minor issue in this commit, and so I've made the following
change to this commit in the ext4 tree.

	       	       	      	     	  - Ted
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 521ce41c242c..3a2ed60ea8b7 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1715,7 +1715,7 @@ static int __jbd2_journal_erase(journal_t *journal, unsigned int flags)
 	if (!q)
 		return -ENXIO;
 
-	if (JBD2_JOURNAL_FLUSH_DISCARD & !blk_queue_discard(q))
+	if ((flags & JBD2_JOURNAL_FLUSH_DISCARD) && !blk_queue_discard(q))
 		return -EOPNOTSUPP;
 
 	/*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help