fs: handle FIEMAP_FLAG_SYNC in fiemap_prep
authorChristoph Hellwig <hch@lst.de>
Sat, 23 May 2020 07:30:14 +0000 (09:30 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 4 Jun 2020 03:16:55 +0000 (23:16 -0400)
commit45dd052e67ad17c7a24874a783f41aeab15bc294
tree8babffcf81e916cbe3e5a21b7bace3a040c0e11d
parentcddf8a2c4a8286ae60fc866eab59c8bc524e93a0
fs: handle FIEMAP_FLAG_SYNC in fiemap_prep

By moving FIEMAP_FLAG_SYNC handling to fiemap_prep we ensure it is
handled once instead of duplicated, but can still be done under fs locks,
like xfs/iomap intended with its duplicate handling.  Also make sure the
error value of filemap_write_and_wait is propagated to user space.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Link: https://lore.kernel.org/r/20200523073016.2944131-8-hch@lst.de
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/btrfs/inode.c
fs/cifs/smb2ops.c
fs/ext4/extents.c
fs/ext4/ioctl.c
fs/f2fs/data.c
fs/ioctl.c
fs/iomap/fiemap.c
fs/nilfs2/inode.c
fs/ocfs2/extent_map.c
fs/overlayfs/inode.c