summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-handle.h
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage/posix/src/posix-handle.h')
-rw-r--r--xlators/storage/posix/src/posix-handle.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix-handle.h b/xlators/storage/posix/src/posix-handle.h
index 0ce9575251f..3af1a70b31a 100644
--- a/xlators/storage/posix/src/posix-handle.h
+++ b/xlators/storage/posix/src/posix-handle.h
@@ -146,6 +146,8 @@
break; \
var = alloca (__len); \
__len = posix_handle_path (this, gfid, base, var, __len); \
+ if (__len <= 0) \
+ var = NULL; \
} while (0)
@@ -192,7 +194,13 @@
errno = 0; \
op_ret = posix_istat (this, loc->gfid, NULL, iatt_p); \
if (errno != ELOOP) { \
- MAKE_HANDLE_PATH (rpath, this, loc->gfid, NULL); \
+ MAKE_HANDLE_PATH (rpath, this, (loc)->gfid, NULL); \
+ if (!rpath) { \
+ op_ret = -1; \
+ gf_log (this->name, GF_LOG_ERROR, \
+ "Failed to create inode handle " \
+ "for path %s", (loc)->path); \
+ } \
break; \
} \
/* __ret == -1 && errno == ELOOP */ \
@@ -220,6 +228,11 @@
if (errno != ELOOP) { \
MAKE_HANDLE_PATH (parp, this, loc->pargfid, NULL); \
MAKE_HANDLE_PATH (entp, this, loc->pargfid, loc->name); \
+ if (!parp || !entp) { \
+ gf_log (this->name, GF_LOG_ERROR, \
+ "Failed to create entry handle " \
+ "for path %s", loc->path); \
+ } \
break; \
} \
/* __ret == -1 && errno == ELOOP */ \