diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-02-25 14:42:03 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2006-02-25 14:42:03 +0000 |
commit | aa8258e9fb887d45c0a5754f158015e035ce37bc (patch) | |
tree | e15cd7036ebc155b73501024205427a751035d7d /kernel | |
parent | a039f8fa00c1aea3291a16253f94aaa98389fdbd (diff) | |
download | libfuse-aa8258e9fb887d45c0a5754f158015e035ce37bc.tar.gz |
fix
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/dir.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/dir.c b/kernel/dir.c index 478f576..1cee4a2 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -117,6 +117,8 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) /* Doesn't hurt to "reset" the validity timeout */ fuse_invalidate_entry_cache(entry); + + /* For negative dentries, always do a fresh lookup */ if (!inode) return 0; @@ -128,6 +130,9 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) fuse_lookup_init(req, entry->d_parent->d_inode, entry, &outarg); request_send(fc, req); err = req->out.h.error; + /* Zero nodeid is same as -ENOENT */ + if (!err && !outarg.nodeid) + err = -ENOENT; if (!err) { struct fuse_inode *fi = get_fuse_inode(inode); if (outarg.nodeid != get_node_id(inode)) { @@ -217,8 +222,9 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry, fuse_lookup_init(req, dir, entry, &outarg); request_send(fc, req); err = req->out.h.error; - if (!err && ((outarg.nodeid && invalid_nodeid(outarg.nodeid)) || - !valid_mode(outarg.attr.mode))) + /* Zero nodeid is same as -ENOENT, but with valid timeout */ + if (!err && outarg.nodeid && + (invalid_nodeid(outarg.nodeid) || !valid_mode(outarg.attr.mode))) err = -EIO; if (!err && outarg.nodeid) { inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation, |