]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: abort unaligned nowait directio early
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 18 Jul 2019 23:06:17 +0000 (23:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:13:05 +0000 (09:13 +0200)
commit2c1e1b8bbf4700f45d5b1d0b0e14f25400590642
treee33fd59981b1fc7838c2878908fc80453e828b49
parente57da6e2a2d625106e1389ac14dd3cc0e7cee861
xfs: abort unaligned nowait directio early

[ Upstream commit 1fdeaea4d92c69fb9f871a787af6ad00f32eeea7 ]

Dave Chinner noticed that xfs_file_dio_aio_write returns EAGAIN without
dropping the IOLOCK when its deciding not to wait, which means that we
leak the IOLOCK there.  Since we now make unaligned directio always
wait, we have the opportunity to bail out before trying to take the
lock, which should reduce the overhead of this never-gonna-work case
considerably while also solving the dropped lock problem.

Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/xfs_file.c