]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
fuse: fix attributes after open(O_TRUNC)
authorKen Sumrall <ksumrall@android.com>
Wed, 24 Nov 2010 20:57:00 +0000 (12:57 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Mar 2011 19:44:06 +0000 (12:44 -0700)
commita60d4074da9aa368a668d53c17fb1033a8a256fe
tree6ac0692cd678a9fa50e176f1d90c07420520c228
parenteef5b035840ebdcdaa6ed18591c8e9e9cebb668c
fuse: fix attributes after open(O_TRUNC)

commit a0822c55779d9319939eac69f00bb729ea9d23da upstream.

The attribute cache for a file was not being cleared when a file is opened
with O_TRUNC.

If the filesystem's open operation truncates the file ("atomic_o_trunc"
feature flag is set) then the kernel should invalidate the cached st_mtime
and st_ctime attributes.

Also i_size should be explicitly be set to zero as it is used sometimes
without refreshing the cache.

Signed-off-by: Ken Sumrall <ksumrall@android.com>
Cc: Anfei <anfei.zhou@gmail.com>
Cc: "Anand V. Avati" <avati@gluster.com>
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/fuse/file.c