[Devel] [PATCH RH7 1/3] ext4: track writeback errors using the generic tracking infrastructure

Kirill Tkhai ktkhai at virtuozzo.com
Thu Jun 3 10:18:28 MSK 2021


From: Theodore Ts'o <tytso at mit.edu>

ms commit 95cb67138746

We already using mapping_set_error() in fs/ext4/page_io.c, so all we
need to do is to use file_check_and_advance_wb_err() when handling
fsync() requests in ext4_sync_file().

Signed-off-by: Theodore Ts'o <tytso at mit.edu>
Cc: stable at kernel.org
---
 fs/ext4/fsync.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 5bccf2ad1b34..ef1b88177220 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -147,6 +147,9 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
 			ret = err;
 	}
 out:
+	err = file_check_and_advance_wb_err(file);
+	if (ret == 0)
+		ret = err;
 	trace_ext4_sync_file_exit(inode, ret);
 	return ret;
 }




More information about the Devel mailing list