All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix bug in FUSE where the attribute cache for a file was not cleared when a file is opened with O_TRUNC.
@ 2010-10-29 23:41 Ken Sumrall
  2010-10-30  0:02 ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Ken Sumrall @ 2010-10-29 23:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ken Sumrall, Miklos Szeredi, Andrew Morton, Jens Axboe, Anfei,
	Anand V. Avati, fuse-devel

Signed-off-by: Ken Sumrall <ksumrall@android.com>
---
 fs/fuse/file.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index c822458..4fbe62c 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -134,6 +134,7 @@ EXPORT_SYMBOL_GPL(fuse_do_open);
 void fuse_finish_open(struct inode *inode, struct file *file)
 {
 	struct fuse_file *ff = file->private_data;
+	struct fuse_conn *fc = get_fuse_conn(inode);
 
 	if (ff->open_flags & FOPEN_DIRECT_IO)
 		file->f_op = &fuse_direct_io_file_operations;
@@ -141,6 +142,8 @@ void fuse_finish_open(struct inode *inode, struct file *file)
 		invalidate_inode_pages2(inode->i_mapping);
 	if (ff->open_flags & FOPEN_NONSEEKABLE)
 		nonseekable_open(inode, file);
+	if (fc->atomic_o_trunc && (file->f_flags & O_TRUNC))
+		fuse_invalidate_attr(inode);
 }
 
 int fuse_open_common(struct inode *inode, struct file *file, bool isdir)
-- 
1.7.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-12  9:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-29 23:41 [PATCH] Fix bug in FUSE where the attribute cache for a file was not cleared when a file is opened with O_TRUNC Ken Sumrall
2010-10-30  0:02 ` Andrew Morton
     [not found]   ` <AANLkTimJWX5WnG6oiUfBxiD=BBJ=Q5iRc73iar=gPKCy@mail.gmail.com>
2010-10-30  0:37     ` Fwd: " Ken Sumrall
2010-10-30 11:31     ` Miklos Szeredi
2010-11-01 23:38       ` Ken Sumrall
2010-11-11 22:10       ` Andrew Morton
2010-11-12  9:37         ` Miklos Szeredi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.