From: Dave Chinner Date: Tue, 16 Aug 2016 22:41:10 +0000 (+1000) Subject: iomap: fiemap should honor the FIEMAP_FLAG_SYNC flag X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8896b8f60951ff0a8b7092f495a445714a1bddc4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iomap: fiemap should honor the FIEMAP_FLAG_SYNC flag The flag is checked as supported, but then we do an unconditional sync of the file, regardless of whether the flag is set or not. Make the sync conditional on having the FIEMAP_FLAG_SYNC flag set. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- diff --git a/fs/iomap.c b/fs/iomap.c index 74712e25184b..56c19e617a26 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -467,9 +467,11 @@ int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi, if (ret) return ret; - ret = filemap_write_and_wait(inode->i_mapping); - if (ret) - return ret; + if (fi->fi_flags & FIEMAP_FLAG_SYNC) { + ret = filemap_write_and_wait(inode->i_mapping); + if (ret) + return ret; + } while (len > 0) { ret = iomap_apply(inode, start, len, 0, ops, &ctx,