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().
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@example.com>
Reviewed-by: Christoph Hellwig <firstname.lastname@example.org>
Reviewed-by: Josef Bacik <email@example.com>
Reviewed-by: Darrick J. Wong <firstname.lastname@example.org>
Signed-off-by: Darrick J. Wong <email@example.com>
1 file changed