lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 29 Mar 2023 17:49:34 +0200
From:   Jan Kara <jack@...e.cz>
To:     Ted Tso <tytso@....edu>
Cc:     <linux-ext4@...r.kernel.org>, Jan Kara <jack@...e.cz>
Subject: [PATCH 03/13] ext4: Keep pages with journalled data dirty

Currently we clear page dirty bit when we checkpoint some buffers from a
page with journalled data or when we perform delayed dirtying of a page
in ext4_writepages(). In a quest to simplify handling of journalled data
we want to keep page dirty as long as it has either buffers to
checkpoint or journalled dirty data. So make sure to keep page dirty in
ext4_writepages() if it still has journalled data attached to it.

Signed-off-by: Jan Kara <jack@...e.cz>
---
 fs/ext4/inode.c   | 1 -
 fs/ext4/page-io.c | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 73e24e61fdd2..78e29da70af7 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2387,7 +2387,6 @@ static int mpage_journal_page_buffers(handle_t *handle,
 	int len;
 
 	ClearPageChecked(page);
-	clear_page_dirty_for_io(page);
 	mpd->wbc->nr_to_write--;
 
 	if (page->index == size >> PAGE_SHIFT &&
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 8703fd732abb..23b29a50b159 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -484,9 +484,11 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
 			 * to redirty the page and keep TOWRITE tag so that
 			 * racing WB_SYNC_ALL writeback does not skip the page.
 			 * This happens e.g. when doing writeout for
-			 * transaction commit.
+			 * transaction commit or when journalled data is not
+			 * yet committed.
 			 */
-			if (buffer_dirty(bh)) {
+			if (buffer_dirty(bh) ||
+			    (buffer_jbd(bh) && buffer_jbddirty(bh))) {
 				if (!PageDirty(page))
 					redirty_page_for_writepage(wbc, page);
 				keep_towrite = true;
-- 
2.35.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ