summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-04-30 16:26:03 +0530
committerNiels de Vos <ndevos@redhat.com>2015-06-28 12:51:01 -0700
commit734f68f4116fd32066aa49cda93707b02ba194cf (patch)
tree3612933adf18283b75339f4eeb0532a34a6a5aef
parent55bd875f0bf9edc92e42c4822c929fb0ace77086 (diff)
posix: handle failure from posix_resolve
This is backport of http://review.gluster.org/#/c/9941/ > When building ancestory, posix_resolve gets the inode > from the gfid. We need to handle the failure case from > this function > > Change-Id: I19f0f0c739686b1b0ef96309212aa1c7911b3589 > BUG: 1203629 > Signed-off-by: vmallika <vmallika@redhat.com> > Reviewed-on: http://review.gluster.org/9941 > Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> > Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Change-Id: If3f9a910be3d08293199748c9e04b3be2d8633c7 BUG: 1217432 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/10471 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
-rw-r--r--xlators/storage/posix/src/posix-handle.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c
index bc57863..d3b94ff 100644
--- a/xlators/storage/posix/src/posix-handle.c
+++ b/xlators/storage/posix/src/posix-handle.c
@@ -175,6 +175,10 @@ posix_make_ancestryfromgfid (xlator_t *this, char *path, int pathsize,
memset (&iabuf, 0, sizeof (iabuf));
inode = posix_resolve (this, itable, *parent, dir_name, &iabuf);
+ if (inode == NULL) {
+ ret = -1;
+ goto out;
+ }
ret = posix_make_ancestral_node (priv_base_path, path, pathsize, head,
dir_name, &iabuf, inode, type, xdata);