]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext3: Fix fdatasync() for files with only i_size changes
authorJan Kara <jack@suse.cz>
Mon, 3 Sep 2012 14:50:42 +0000 (16:50 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Sep 2012 14:04:37 +0000 (15:04 +0100)
commit33c5063fd1deb751e11e240cb88a6795306ce5cc
tree034c75966ce2e227bb2fb15998a4ccd9f5f3c902
parent78e96c146124c1ebbd9387bc2d26185b262563b9
ext3: Fix fdatasync() for files with only i_size changes

commit 156bddd8e505b295540f3ca0e27dda68cb0d49aa upstream.

Code tracking when transaction needs to be committed on fdatasync(2) forgets
to handle a situation when only inode's i_size is changed. Thus in such
situations fdatasync(2) doesn't force transaction with new i_size to disk
and that can result in wrong i_size after a crash.

Fix the issue by updating inode's i_datasync_tid whenever its size is
updated.

Reported-by: Kristian Nielsen <knielsen@knielsen-hq.org>
Signed-off-by: Jan Kara <jack@suse.cz>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext3/inode.c