summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs-common.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-05-06 08:36:15 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-08 06:37:29 -0700
commitc8a94aa7c522e7c820ae181c6f60e657bc12ea6d (patch)
tree54f8d97ca18fe6072bbb08a213d0f9af522e2817 /xlators/nfs/server/src/nfs-common.c
parent9dabc8b0a9a2582004e3f8a14e5d8cac201ce01a (diff)
nfs: Handle failed parent loc filling
Just because an inode_get for parent (ino, gen) returns a valid inode_t does not meant that the inode_path(..in nfs_parent_inode_loc_fill..) will return successfully. The failure of nfs_parent_inode_loc_fill was not handled resulting in a NULL path being passed for the fop. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 857 (Crash in afr_sh_entry_expunge_entry_cbk) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=857
Diffstat (limited to 'xlators/nfs/server/src/nfs-common.c')
-rw-r--r--xlators/nfs/server/src/nfs-common.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c
index 69bf46702eb..5609b8efe7e 100644
--- a/xlators/nfs/server/src/nfs-common.c
+++ b/xlators/nfs/server/src/nfs-common.c
@@ -338,19 +338,19 @@ nfs_entry_loc_fill (inode_table_t *itable, ino_t ino, uint64_t gen, char *entry,
ret = -2;
entryinode = inode_grep (itable, parent, entry);
if (!entryinode) {
- if (how != NFS_RESOLVE_CREATE)
- goto err;
- else {
+ if (how == NFS_RESOLVE_CREATE) {
/* Even though we'll create the inode and the loc for
* a missing inode, we still need to return -2 so
* that the caller can use the filled loc to call
* lookup.
*/
entryinode = inode_new (itable);
- nfs_parent_inode_loc_fill (parent, entryinode, entry,
- loc);
- goto err;
+ ret = nfs_parent_inode_loc_fill (parent, entryinode,
+ entry, loc);
+ if (ret < 0)
+ ret = -3;
}
+ goto err;
}
ret = inode_path (parent, entry, &resolvedpath);