2007-11-15 11:18:18

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 1/2] fuse: fix uninitialized field in fuse_inode

Andrew,

Please queue these two fixes for 2.6.24, along with the rest of the
fuse patches currently in -mm.

Thanks,
Miklos

----
From: John Muir <[email protected]>

I found problems accessing (executing) previously existing files, until
I did chmod on them (or setattr).

If the fi->attr_version is not initialized, then it could be
larger than fc->attr_version until a setattr is executed, and as a
result the inode attributes would never be set.

Signed-off-by: Miklos Szeredi <[email protected]>
---

Index: linux/fs/fuse/inode.c
===================================================================
--- linux.orig/fs/fuse/inode.c 2007-11-13 17:44:53.000000000 +0100
+++ linux/fs/fuse/inode.c 2007-11-13 17:49:13.000000000 +0100
@@ -56,6 +56,7 @@ static struct inode *fuse_alloc_inode(st
fi->i_time = 0;
fi->nodeid = 0;
fi->nlookup = 0;
+ fi->attr_version = 0;
INIT_LIST_HEAD(&fi->write_files);
fi->forget_req = fuse_request_alloc();
if (!fi->forget_req) {


2007-11-15 11:20:00

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 2/2] fuse: fix attribute caching after rename

Invalidate attributes on rename, since some filesystems may update
st_ctime. Reported by Szabolcs Szakacsits

Signed-off-by: Miklos Szeredi <[email protected]>
---

Index: linux-2.6.24-rc2/fs/fuse/dir.c
===================================================================
--- linux-2.6.24-rc2.orig/fs/fuse/dir.c 2007-11-13 18:43:40.000000000 +0100
+++ linux-2.6.24-rc2/fs/fuse/dir.c 2007-11-13 18:44:58.000000000 +0100
@@ -646,6 +646,9 @@ static int fuse_rename(struct inode *old
err = req->out.h.error;
fuse_put_request(fc, req);
if (!err) {
+ /* ctime changes */
+ fuse_invalidate_attr(oldent->d_inode);
+
fuse_invalidate_attr(olddir);
if (olddir != newdir)
fuse_invalidate_attr(newdir);