]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: use i_mutex to serialize unaligned AIO DIO
authorJan Kara <jack@suse.cz>
Wed, 9 Mar 2016 03:44:50 +0000 (22:44 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 9 Mar 2016 03:44:50 +0000 (22:44 -0500)
commit657138e514f8f6daf5e94182864952fa32901970
treec86f41730d37a0f1424ee5c0cdb9c9017121d6d0
parent81a4bccf1551166d8636f925eeea061c98902526
ext4: use i_mutex to serialize unaligned AIO DIO

Currently we've used hashed aio_mutex to serialize unaligned AIO DIO.
However the code cleanups that happened after 2011 when the lock was
introduced made aio_mutex acquired at almost the same places where we
already have exclusion using i_mutex. So just use i_mutex for the
exclusion of unaligned AIO DIO.

The change moves waiting for pending unwritten extent conversion under
i_mutex. That makes special handling of O_APPEND writes unnecessary and
also avoids possible livelocking of unaligned AIO DIO with aligned one
(nothing was preventing contiguous stream of aligned AIO DIOs to let
unaligned AIO DIO wait forever).

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/file.c
fs/ext4/super.c