]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix locking for O_APPEND writes
authorTheodore Ts'o <tytso@mit.edu>
Mon, 21 Apr 2014 18:37:52 +0000 (14:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 21 Apr 2014 18:37:52 +0000 (14:37 -0400)
commit95e4ee86b144b0ecc2710eb850f7dd95ebfbba0b
treef79ae8f5ac9b34cbb3cb73f14f9706905219aa6b
parent7b60f30a4666eef4e5af46d0b1197322e35691e3
ext4: fix locking for O_APPEND writes

Al Viro pointed out that locking for O_APPEND writes was problematic,
since the location of the write isn't known until after we take the
i_mutex, which impacts the ext4_unaligned_aio() and s_bitmap_maxbytes
check.

For O_APPEND always assume that the write is unaligned so call
ext4_unwritten_wait().  And to solve the second problem, take the
i_mutex earlier before we start the s_bitmap_maxbytes check.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/file.c