]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/iomap.c
iomap: fiemap should honor the FIEMAP_FLAG_SYNC flag
[mirror_ubuntu-bionic-kernel.git] / fs / iomap.c
index 74712e25184ba421a19034dfd832b1ddd5aa49cb..56c19e617a265370cb395e939e78f1772eb49f10 100644 (file)
@@ -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,