Whamcloud - gitweb
LU-17124 llite: Write and wait on FIEMAP_FLAG_SYNC 02/52402/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Mon, 18 Sep 2023 10:42:24 +0000 (05:42 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 28 Sep 2023 08:02:43 +0000 (08:02 +0000)
fiemap FIEMAP_FLAG_SYNC flag expects filemap_write_and_wait()

HPE-bug-id: LUS-11854
Fixes: c16ecc8600 ("LU-5823 clio: add cl_object_fiemap()")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I40aa8d423164cf460fda5c11093a5f7b25682a96
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52402
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c

index 5c078c0..5178a27 100644 (file)
@@ -2936,7 +2936,7 @@ static int ll_do_fiemap(struct inode *inode, struct fiemap *fiemap,
 
        /* Check for FIEMAP_FLAG_SYNC */
        if (fiemap->fm_flags & FIEMAP_FLAG_SYNC) {
-               rc = filemap_fdatawrite(inode->i_mapping);
+               rc = filemap_write_and_wait(inode->i_mapping);
                if (rc)
                        return rc;
        }