aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/fuse/dir.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 21fd59c7bc24..c72a8a97935c 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -111,6 +111,8 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
111 111
112 /* Doesn't hurt to "reset" the validity timeout */ 112 /* Doesn't hurt to "reset" the validity timeout */
113 fuse_invalidate_entry_cache(entry); 113 fuse_invalidate_entry_cache(entry);
114
115 /* For negative dentries, always do a fresh lookup */
114 if (!inode) 116 if (!inode)
115 return 0; 117 return 0;
116 118
@@ -122,6 +124,9 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
122 fuse_lookup_init(req, entry->d_parent->d_inode, entry, &outarg); 124 fuse_lookup_init(req, entry->d_parent->d_inode, entry, &outarg);
123 request_send(fc, req); 125 request_send(fc, req);
124 err = req->out.h.error; 126 err = req->out.h.error;
127 /* Zero nodeid is same as -ENOENT */
128 if (!err && !outarg.nodeid)
129 err = -ENOENT;
125 if (!err) { 130 if (!err) {
126 struct fuse_inode *fi = get_fuse_inode(inode); 131 struct fuse_inode *fi = get_fuse_inode(inode);
127 if (outarg.nodeid != get_node_id(inode)) { 132 if (outarg.nodeid != get_node_id(inode)) {
@@ -190,8 +195,9 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
190 fuse_lookup_init(req, dir, entry, &outarg); 195 fuse_lookup_init(req, dir, entry, &outarg);
191 request_send(fc, req); 196 request_send(fc, req);
192 err = req->out.h.error; 197 err = req->out.h.error;
193 if (!err && ((outarg.nodeid && invalid_nodeid(outarg.nodeid)) || 198 /* Zero nodeid is same as -ENOENT, but with valid timeout */
194 !valid_mode(outarg.attr.mode))) 199 if (!err && outarg.nodeid &&
200 (invalid_nodeid(outarg.nodeid) || !valid_mode(outarg.attr.mode)))
195 err = -EIO; 201 err = -EIO;
196 if (!err && outarg.nodeid) { 202 if (!err && outarg.nodeid) {
197 inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation, 203 inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,