diff options
| -rw-r--r-- | xlators/features/marker/src/marker.c | 25 | ||||
| -rw-r--r-- | xlators/storage/posix/src/posix.c | 5 | 
2 files changed, 19 insertions, 11 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index d6b6dd358de..45058652bca 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -1021,7 +1021,7 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this,          if (op_ret < 0) {                  if (local->err == 0) { -                        local->err = op_errno; +                        local->err =  op_errno ? op_errno : EINVAL;                  }                  gf_log (this->name, GF_LOG_WARNING, @@ -1037,6 +1037,11 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this,          } else if (local->err != 0) {                  STACK_UNWIND_STRICT (rename, frame, -1, local->err, NULL, NULL,                                       NULL, NULL, NULL, NULL); +        } else { +                gf_log (this->name, GF_LOG_CRITICAL, +                        "continuation stub to unwind the call is absent, hence " +                        "call will be hung (call-stack id = %"PRIu64")", +                        frame->root->unique);          }          mq_reduce_parent_size (this, &oplocal->loc, oplocal->contribution); @@ -1082,7 +1087,7 @@ marker_rename_release_newp_lock (call_frame_t *frame, void *cookie,          if (op_ret < 0) {                  if (local->err == 0) { -                        local->err = op_errno; +                        local->err = op_errno ? op_errno : EINVAL;                  }                  gf_log (this->name, GF_LOG_WARNING, @@ -1271,7 +1276,7 @@ marker_do_rename (call_frame_t *frame, void *cookie, xlator_t *this,                  MARKER_RESET_UID_GID (frame, frame->root, local);          if ((op_ret < 0) && (op_errno != ENOATTR)) { -                local->err = op_errno; +                local->err = op_errno ? op_errno : EINVAL;                  gf_log (this->name, GF_LOG_WARNING,                          "fetching contribution values from %s (gfid:%s) "                          "failed (%s)", local->loc.path, @@ -1283,7 +1288,7 @@ marker_do_rename (call_frame_t *frame, void *cookie, xlator_t *this,          if (local->loc.inode != NULL) {                  GET_CONTRI_KEY (contri_key, local->loc.parent->gfid, ret);                  if (ret < 0) { -                        local->err = errno; +                        local->err = errno ? errno : ENOMEM;                          goto err;                  } @@ -1323,7 +1328,7 @@ marker_get_newpath_contribution (call_frame_t *frame, void *cookie,                  MARKER_RESET_UID_GID (frame, frame->root, local);          if ((op_ret < 0) && (op_errno != ENOATTR)) { -                local->err = op_errno; +                local->err = op_errno ? op_errno : EINVAL;                  gf_log (this->name, GF_LOG_WARNING,                          "fetching contribution values from %s (gfid:%s) "                          "failed (%s)", oplocal->loc.path, @@ -1334,7 +1339,7 @@ marker_get_newpath_contribution (call_frame_t *frame, void *cookie,          GET_CONTRI_KEY (contri_key, oplocal->loc.parent->gfid, ret);          if (ret < 0) { -                local->err = errno; +                local->err = errno ? errno : ENOMEM;                  goto err;          } @@ -1344,7 +1349,7 @@ marker_get_newpath_contribution (call_frame_t *frame, void *cookie,          if (local->loc.inode != NULL) {                  GET_CONTRI_KEY (contri_key, local->loc.parent->gfid, ret);                  if (ret < 0) { -                        local->err = errno; +                        local->err = errno ? errno : ENOMEM;                          goto err;                  } @@ -1385,7 +1390,7 @@ marker_get_oldpath_contribution (call_frame_t *frame, void *cookie,          oplocal = local->oplocal;          if (op_ret < 0) { -                local->err = op_errno; +                local->err = op_errno ? op_errno : EINVAL;                  gf_log (this->name, GF_LOG_WARNING,                          "cannot hold inodelk on %s (gfid:%s) (%s)",                          local->next_lock_on->path, @@ -1396,7 +1401,7 @@ marker_get_oldpath_contribution (call_frame_t *frame, void *cookie,          GET_CONTRI_KEY (contri_key, oplocal->loc.parent->gfid, ret);          if (ret < 0) { -                local->err = errno; +                local->err = errno ? errno : ENOMEM;                  goto quota_err;          } @@ -1452,7 +1457,7 @@ marker_rename_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                          loc = &local->parent_loc;                  } -                local->err = op_errno; +                local->err = op_errno ? op_errno : EINVAL;                  gf_log (this->name, GF_LOG_WARNING,                          "cannot hold inodelk on %s (gfid:%s) (%s)",                          loc->path, uuid_utoa (loc->inode->gfid), diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index ba928de2af0..fde322099fe 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3383,7 +3383,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,          dict = dict_new ();          if (!dict) { -		op_errno = ENOMEM; +                op_errno = ENOMEM;                  goto out;          } @@ -3550,6 +3550,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); @@ -3565,6 +3566,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); @@ -3642,6 +3644,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);  | 
