diff options
-rw-r--r-- | libglusterfs/src/inode.c | 5 | ||||
-rw-r--r-- | xlators/nfs/server/src/nfs3.c | 8 | ||||
-rw-r--r-- | xlators/protocol/server/src/server3_1-fops.c | 6 |
3 files changed, 11 insertions, 8 deletions
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index fed23ae3539..1db8297923a 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -851,6 +851,11 @@ __inode_link (inode_t *inode, inode_t *parent, const char *name, } } + if (name) { + if (!strcmp(name, ".") || !strcmp(name, "..")) + return link_inode; + } + /* use only link_inode beyond this point */ if (parent) { old_dentry = __dentry_grep (table, parent, name); diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index a155b4e8ab1..f950b9273ee 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -1410,12 +1410,8 @@ nfs3_lookup (rpcsvc_request_t *req, struct nfs3_fh *fh, int fhlen, char *name) nfs3_handle_call_state_init (nfs3, cs, req, vol, stat, nfs3err); cs->lookuptype = GF_NFS3_REVALIDATE; - if (!nfs3_is_parentdir_entry (name)) - ret = nfs3_fh_resolve_and_resume (cs, fh, name, - nfs3_lookup_resume); - else - ret = nfs3_fh_resolve_and_resume (cs, fh, NULL, - nfs3_lookup_parentdir_resume); + ret = nfs3_fh_resolve_and_resume (cs, fh, name, + nfs3_lookup_resume); if (ret < 0) { gf_log (GF_NFS, GF_LOG_ERROR, "failed to start hard reslove"); diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 0e252b5c3d7..10dddd79b16 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -120,8 +120,10 @@ server_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (!__is_root_gfid (inode->gfid)) { link_inode = inode_link (inode, state->loc.parent, state->loc.name, stbuf); - inode_lookup (link_inode); - inode_unref (link_inode); + if (link_inode) { + inode_lookup (link_inode); + inode_unref (link_inode); + } } } else { if (state->is_revalidate && op_errno == ENOENT) { |