]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: race-condition protection for ext4_convert_unwritten_extents_endio
authorDmitry Monakhov <dmonakhov@openvz.org>
Wed, 10 Oct 2012 05:04:58 +0000 (01:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Oct 2012 17:14:12 +0000 (10:14 -0700)
commit4319fd00002630a761fa5559a086f11ed7623006
treec6af97d9649f3b95787bd9fe688a837a0a206ba2
parent553f672df76c6213b9a7e644b1d878204a61e013
ext4: race-condition protection for ext4_convert_unwritten_extents_endio

commit dee1f973ca341c266229faa5a1a5bb268bed3531 upstream.

We assumed that at the time we call ext4_convert_unwritten_extents_endio()
extent in question is fully inside [map.m_lblk, map->m_len] because
it was already split during submission.  But this may not be true due to
a race between writeback vs fallocate.

If extent in question is larger than requested we will split it again.
Special precautions should being done if zeroout required because
[map.m_lblk, map->m_len] already contains valid data.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c