]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ext4: fix fdatasync() for files with only i_size changes
authorJan Kara <jack@suse.cz>
Thu, 27 Sep 2012 01:52:20 +0000 (21:52 -0400)
committerGuangyu Sun <guangyu.sun@oracle.com>
Wed, 17 Oct 2012 18:24:31 +0000 (11:24 -0700)
commit33e8845b81c39f1e7e2d312f228fd890d84f69cb
treec626558ef85a5e13f084064c63323a74fbaa8f0e
parente08f56d239fb26d32ab74d724b290ed7c6f1fdbb
ext4: fix fdatasync() for files with only i_size changes

commit b71fc079b5d8f42b2a52743c8d2f1d35d655b1c5 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
fs/ext4/inode.c