aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_ialloc_btree.c
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <[email protected]>2020-09-28 08:51:08 -0700
committerDarrick J. Wong <[email protected]>2020-09-28 08:51:08 -0700
commit1a31182edd0083bb9f26e582ed39f92f898c4d0a (patch)
tree8bbfb19660649ede924df743a4cc1db1ed645b02 /fs/xfs/libxfs/xfs_ialloc_btree.c
parentc3d4ed1abecfcfc801199cfadb71f5b80e025d9e (diff)
iomap: Call inode_dio_end() before generic_write_sync()
iomap complete routine can deadlock with btrfs_fallocate because of the call to generic_write_sync(). P0 P1 inode_lock() fallocate(FALLOC_FL_ZERO_RANGE) __iomap_dio_rw() inode_lock() <block> <submits IO> <completes IO> inode_unlock() <gets inode_lock()> inode_dio_wait() iomap_dio_complete() generic_write_sync() btrfs_file_fsync() inode_lock() <deadlock> inode_dio_end() is used to notify the end of DIO data in order to synchronize with truncate. Call inode_dio_end() before calling generic_write_sync(), so filesystems can lock i_rwsem during a sync. This matches the way it is done in fs/direct-io.c:dio_complete(). Signed-off-by: Goldwyn Rodrigues <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Josef Bacik <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
Diffstat (limited to 'fs/xfs/libxfs/xfs_ialloc_btree.c')
0 files changed, 0 insertions, 0 deletions