]> git.karo-electronics.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)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:14 +0000 (23:40 +0100)
commit962b4a64f5210a4aaefd09c318e6dd05242df0ce
treea1621c1291211b3efbe3c8ead0e32db2bd9fb284
parentc526b926bacd31f398384c42c1950dc077c903b9
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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
fs/fuse/file.c