diff options
author | vmallika <vmallika@redhat.com> | 2015-03-19 07:02:24 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-05-27 05:18:13 -0700 |
commit | d0f62e8b4fc605c522f7971a82cbbf027e06960e (patch) | |
tree | 2a508dcc107f30a2694fa05625513a57c5871898 | |
parent | 1661ac3cfabdbdc39c18adb18e55ac6b85e3d05d (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: I9933b653e6bdf9fbfd1f65081622f47ed7f25e45
BUG: 1217419
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/10469
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-rw-r--r-- | xlators/storage/posix/src/posix-handle.c | 4 |
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 ab202d79dc9..19f27b3c284 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, |