[Devel] [PATCH RHEL7 COMMIT] ms/ext4: track writeback errors using the generic tracking infrastructure

Vasily Averin vvs at virtuozzo.com
Fri Jun 18 16:07:57 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.31.1.vz7.181.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.31.1.vz7.181.4
------>
commit 3715a492f50c16476c82b3c70c3b344a6c4be98e
Author: Theodore Ts'o <tytso at mit.edu>
Date:   Fri Jun 18 16:07:57 2021 +0300

    ms/ext4: track writeback errors using the generic tracking infrastructure
    
    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
    https://jira.sw.ru/browse/PSBM-129846
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 fs/ext4/fsync.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 5bccf2a..ef1b881 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