From c8a94aa7c522e7c820ae181c6f60e657bc12ea6d Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 6 May 2010 08:36:15 +0000 Subject: 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 Signed-off-by: Anand V. Avati BUG: 857 (Crash in afr_sh_entry_expunge_entry_cbk) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=857 --- xlators/nfs/server/src/nfs-common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xlators/nfs/server/src/nfs-common.c') 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); -- cgit