summaryrefslogtreecommitdiffstats
path: root/fs/afs/super.c
diff options
context:
space:
mode:
authorJan Kara2011-06-14 00:58:27 +0200
committerAl Viro2011-06-16 17:44:46 +0200
commitf9f07b6c1372b1436aa6b45333445b443ffd8c95 (patch)
treeb8bd034260b2c1eee2ca585397ee598079ac261b /fs/afs/super.c
parentafs: afs_fill_page reads too much, or wrong data (diff)
downloadkernel-qcow2-linux-f9f07b6c1372b1436aa6b45333445b443ffd8c95.tar.gz
kernel-qcow2-linux-f9f07b6c1372b1436aa6b45333445b443ffd8c95.tar.xz
kernel-qcow2-linux-f9f07b6c1372b1436aa6b45333445b443ffd8c95.zip
vfs: Fix data corruption after failed write in __block_write_begin()
I've got a report of a file corruption from fsxlinux on ext3. The important operations to the page were: mapwrite to a hole partial write to the page read - found the page zeroed from the end of the normal write The culprit seems to be that if get_block() fails in __block_write_begin() (e.g. transient ENOSPC in ext3), the function does ClearPageUptodate(page). Thus when we retry the write, the logic in __block_write_begin() thinks zeroing of the page is needed and overwrites old data. In fact, I don't see why we should ever need to zero the uptodate bit here - either the page was uptodate when we entered __block_write_begin() and it should stay so when we leave it, or it was not uptodate and noone had right to set it uptodate during __block_write_begin() so it remains !uptodate when we leave as well. So just remove clearing of the bit. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/afs/super.c')
0 files changed, 0 insertions, 0 deletions