summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2013-05-18 11:52:09 +0530
committerNiels de Vos <ndevos@redhat.com>2014-05-10 19:36:10 -0700
commitbe331ce48633943743bbbe9665f44204e4437dee (patch)
treeb38ede28c98a610060c852ee3c19a172dcf9f384 /xlators/storage/posix/src
parent46bf591eb87d743baacd30a85b99fd47db4fb055 (diff)
features/marker-quota: more stringent error handling in rename.
If an error occurs and op_errno is not set to non-zero value, we can end up in loosing a frame resulting in a hung syscall. This patch adds code setting op_errno appropriately in storage/posix and makes marker to set err to a default non-zero value in case of op_errno being zero. Change-Id: Idc2c3e843b932709a69b32ba67deb284547168f2 BUG: 833586 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.org/6913 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src')
-rw-r--r--xlators/storage/posix/src/posix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 6a7e691724e..71daa3e3761 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3393,7 +3393,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
dict = dict_new ();
if (!dict) {
- op_errno = ENOMEM;
+ op_errno = ENOMEM;
goto out;
}
@@ -3562,6 +3562,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
value = GF_CALLOC (size + 1, sizeof(char), gf_posix_mt_char);
if (!value) {
op_ret = -1;
+ op_errno = ENOMEM;
goto out;
}
size = sys_lgetxattr (real_path, key, value, size);
@@ -3577,6 +3578,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
value [size] = '\0';
op_ret = dict_set_dynptr (dict, key, value, size);
if (op_ret < 0) {
+ op_errno = -op_ret;
gf_log (this->name, GF_LOG_ERROR, "dict set operation "
"on %s for the key %s failed.", real_path, key);
GF_FREE (value);
@@ -3656,6 +3658,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
value [size] = '\0';
op_ret = dict_set_dynptr (dict, key, value, size);
if (op_ret < 0) {
+ op_errno = -op_ret;
gf_log (this->name, GF_LOG_ERROR, "dict set operation "
"on %s for the key %s failed.", real_path, key);
GF_FREE (value);