diff options
author | 2005-09-23 11:25:28 +0000 | |
---|---|---|
committer | 2005-09-23 11:25:28 +0000 | |
commit | 6becf0b8644c0536fa12faef3d023134dcb3a100 (patch) | |
tree | 1fc676bcb83e54a3b3c10c552777887ac632e3b6 | |
parent | f45f3c18ab56e1777a051f7d3d181502f4917ad0 (diff) |
fix
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | kernel/dir.c | 8 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,7 @@ +2005-09-23 Miklos Szeredi <miklos@szeredi.hu> + + * Check for special node ID values in LOOKUP/MK* + 2005-09-22 Miklos Szeredi <miklos@szeredi.hu> * Slight optimization in returning EINVAL error in case of an open diff --git a/kernel/dir.c b/kernel/dir.c index e8b2d0f..3428668 100644 --- a/kernel/dir.c +++ b/kernel/dir.c @@ -112,7 +112,9 @@ static int fuse_lookup_iget(struct inode *dir, struct dentry *entry, fuse_lookup_init(req, dir, entry, &outarg); request_send(fc, req); err = req->out.h.error; - if (!err) { + if (!err && outarg.nodeid == FUSE_ROOT_ID) + err = -EIO; + else if (!err && outarg.nodeid) { inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation, &outarg.attr); if (!inode) { @@ -168,6 +170,10 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req, fuse_put_request(fc, req); return err; } + if (!outarg.nodeid || outarg.nodeid == FUSE_ROOT_ID) { + fuse_put_request(fc, req); + return -EIO; + } inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation, &outarg.attr); if (!inode) { |