]> git.baikalelectronics.ru Git - kernel.git/commit
udf: Fix data corruption for files in ICB
authorJan Kara <jack@suse.cz>
Wed, 5 Sep 2012 13:48:23 +0000 (15:48 +0200)
committerJan Kara <jack@suse.cz>
Wed, 5 Sep 2012 14:06:03 +0000 (16:06 +0200)
commitecb5c8e1ebcb0c19b69a7d39eebb99fc5df5d6af
tree4b219b5d83336c2291c928a405d79c7ce0abdfee
parent71992e4663e140831d78219fa190245a89d18028
udf: Fix data corruption for files in ICB

When a file is stored in ICB (inode), we overwrite part of the file, and
the page containing file's data is not in page cache, we end up corrupting
file's data by overwriting them with zeros. The problem is we use
simple_write_begin() which simply zeroes parts of the page which are not
written to. The problem has been introduced by 2befc48a (udf: convert to
new aops).

Fix the problem by providing a ->write_begin function which makes the page
properly uptodate.

CC: <stable@vger.kernel.org> # >= 2.6.24
Reported-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/file.c