From 18dd162e00c8655648cea702bdb7b8bf25f1da97 Mon Sep 17 00:00:00 2001 From: vmallika Date: Thu, 19 Mar 2015 07:02:24 +0530 Subject: posix: handle failure from posix_resolve 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 Reviewed-on: http://review.gluster.org/9941 Reviewed-by: Raghavendra Bhat Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri --- xlators/storage/posix/src/posix-handle.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/storage/posix') diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c index 5d184d930b0..2bf8813f44c 100644 --- a/xlators/storage/posix/src/posix-handle.c +++ b/xlators/storage/posix/src/posix-handle.c @@ -176,6 +176,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; + } strcat (dir_name, "/"); ret = posix_make_ancestral_node (priv_base_path, path, pathsize, head, -- cgit