diff options
author | vmallika <vmallika@redhat.com> | 2015-07-22 14:49:39 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-07-31 05:19:51 -0700 |
commit | 3d6dd0dc25240cea6c319303dc7c876a84f292c9 (patch) | |
tree | aacf21e00174a262336a52ec48165cbd403f1fce | |
parent | 8b7876c2ef2c969c421f9a001c3506e54e6e4aa0 (diff) |
quota/marker: set log-level to debug for ESTALE/ENOENT for marker txn
This is a backport of http://review.gluster.org/11736
For all marker txn, it is possible that while the txn in progress
file can be removed.
So log all ENOENT/ESTALE error in debug level
> Change-Id: I776ba3cda33fe992f9dcc7baede7206c4ce19553
> BUG: 1245544
> Signed-off-by: vmallika <vmallika@redhat.com>
> Reviewed-on: http://review.gluster.org/11736
> Tested-by: Gluster Build System <jenkins@build.gluster.com>
> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Change-Id: Ib914531a217da62b89f098c2b23e40f05cbf7b08
BUG: 1248962
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/11812
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r-- | xlators/features/marker/src/marker-quota.c | 91 |
1 files changed, 33 insertions, 58 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 532c476a24e..2e51f338a31 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -2183,9 +2183,9 @@ mq_are_xattrs_set (xlator_t *this, loc_t *loc, gf_boolean_t *result, ret = syncop_lookup (FIRST_CHILD(this), loc, &stbuf, NULL, dict, &rsp_dict); if (ret < 0) { - gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) - ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " - "for %s: %s", loc->path, strerror (-ret)); + gf_log_callingfn (this->name, (-ret == ENOENT || -ret == ESTALE) + ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " + "for %s: %s", loc->path, strerror (-ret)); goto out; } @@ -2272,13 +2272,13 @@ mq_create_xattrs (xlator_t *this, quota_inode_ctx_t *ctx, loc_t *loc, goto out; } - ret = syncop_xattrop(FIRST_CHILD(this), loc, GF_XATTROP_ADD_ARRAY64, - dict, NULL, NULL); + ret = syncop_xattrop (FIRST_CHILD(this), loc, GF_XATTROP_ADD_ARRAY64, + dict, NULL, NULL); if (ret < 0) { - gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) - ? GF_LOG_DEBUG:GF_LOG_ERROR, "xattrop failed " - "for %s: %s", loc->path, strerror (-ret)); + gf_log_callingfn (this->name, (-ret == ENOENT || -ret == ESTALE) + ? GF_LOG_DEBUG:GF_LOG_ERROR, "xattrop failed " + "for %s: %s", loc->path, strerror (-ret)); goto out; } @@ -2312,9 +2312,9 @@ mq_lock (xlator_t *this, loc_t *loc, short l_type) ret = syncop_inodelk (FIRST_CHILD(this), this->name, loc, F_SETLKW, &lock, NULL, NULL); if (ret < 0) - gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) - ? GF_LOG_DEBUG:GF_LOG_ERROR, "inodelk failed " - "for %s: %s", loc->path, strerror (-ret)); + gf_log_callingfn (this->name, (-ret == ENOENT || -ret == ESTALE) + ? GF_LOG_DEBUG:GF_LOG_ERROR, "inodelk failed " + "for %s: %s", loc->path, strerror (-ret)); out: @@ -2345,9 +2345,9 @@ mq_get_dirty (xlator_t *this, loc_t *loc, int32_t *dirty) ret = syncop_lookup (FIRST_CHILD(this), loc, &stbuf, NULL, dict, &rsp_dict); if (ret < 0) { - gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) - ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " - "for %s: %s", loc->path, strerror (-ret)); + gf_log_callingfn (this->name, (-ret == ENOENT || -ret == ESTALE) + ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " + "for %s: %s", loc->path, strerror (-ret)); goto out; } @@ -2391,7 +2391,7 @@ mq_mark_dirty (xlator_t *this, loc_t *loc, int32_t dirty) ret = syncop_setxattr (FIRST_CHILD(this), loc, dict, 0, NULL, NULL); if (ret < 0) { - gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) + gf_log_callingfn (this->name, (-ret == ENOENT || -ret == ESTALE) ? GF_LOG_DEBUG:GF_LOG_ERROR, "setxattr dirty = %d " "failed for %s: %s", dirty, loc->path, strerror (-ret)); goto out; @@ -2458,9 +2458,9 @@ _mq_get_metadata (xlator_t *this, loc_t *loc, quota_meta_t *contri, ret = syncop_lookup (FIRST_CHILD(this), loc, &stbuf, NULL, dict, &rsp_dict); if (ret < 0) { - gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) - ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " - "for %s: %s", loc->path, strerror (-ret)); + gf_log_callingfn (this->name, (-ret == ENOENT || -ret == ESTALE) + ? GF_LOG_DEBUG:GF_LOG_ERROR, "lookup failed " + "for %s: %s", loc->path, strerror (-ret)); goto out; } @@ -2527,11 +2527,8 @@ mq_get_metadata (xlator_t *this, loc_t *loc, quota_meta_t *contri, } ret = _mq_get_metadata (this, loc, contri, size, contribution->gfid); - if (ret < 0) { - gf_log_callingfn (this->name, GF_LOG_ERROR, "Failed to get " - "metadata for %s", loc->path); + if (ret < 0) goto out; - } if (size) { LOCK (&ctx->lock); @@ -2560,34 +2557,14 @@ out: int32_t mq_get_size (xlator_t *this, loc_t *loc, quota_meta_t *size) { - int32_t ret = -1; - - ret = _mq_get_metadata (this, loc, NULL, size, 0); - if (ret < 0) { - gf_log_callingfn (this->name, GF_LOG_ERROR, "Failed to get " - "metadata for %s", loc->path); - goto out; - } - -out: - return ret; + return _mq_get_metadata (this, loc, NULL, size, 0); } int32_t mq_get_contri (xlator_t *this, loc_t *loc, quota_meta_t *contri, uuid_t contri_gfid) { - int32_t ret = -1; - - ret = _mq_get_metadata (this, loc, contri, NULL, contri_gfid); - if (ret < 0) { - gf_log_callingfn (this->name, GF_LOG_ERROR, "Failed to get " - "metadata for %s", loc->path); - goto out; - } - -out: - return ret; + return _mq_get_metadata (this, loc, contri, NULL, contri_gfid); } int32_t @@ -2642,9 +2619,10 @@ mq_remove_contri (xlator_t *this, loc_t *loc, quota_inode_ctx_t *ctx, */ ret = 0; } else { - gf_log (this->name, GF_LOG_ERROR, "removexattr %s " - "failed for %s: %s", contri_key, loc->path, - strerror (-ret)); + gf_log_callingfn (this->name, GF_LOG_ERROR, + "removexattr %s failed for %s: %s", + contri_key, loc->path, + strerror (-ret)); goto out; } } @@ -2706,9 +2684,9 @@ mq_update_contri (xlator_t *this, loc_t *loc, inode_contribution_t *contri, ret = syncop_xattrop(FIRST_CHILD(this), loc, GF_XATTROP_ADD_ARRAY64, dict, NULL, NULL); if (ret < 0) { - gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) - ? GF_LOG_DEBUG:GF_LOG_ERROR, "xattrop failed " - "for %s: %s", loc->path, strerror (-ret)); + gf_log_callingfn (this->name, (-ret == ENOENT || -ret == ESTALE) + ? GF_LOG_DEBUG:GF_LOG_ERROR, "xattrop failed " + "for %s: %s", loc->path, strerror (-ret)); goto out; } @@ -2765,9 +2743,9 @@ mq_update_size (xlator_t *this, loc_t *loc, quota_meta_t *delta) ret = syncop_xattrop(FIRST_CHILD(this), loc, GF_XATTROP_ADD_ARRAY64, dict, NULL, NULL); if (ret < 0) { - gf_log (this->name, (-ret == ENOENT || -ret == ESTALE) - ? GF_LOG_DEBUG:GF_LOG_ERROR, "xattrop failed " - "for %s: %s", loc->path, strerror (-ret)); + gf_log_callingfn (this->name, (-ret == ENOENT || -ret == ESTALE) + ? GF_LOG_DEBUG:GF_LOG_ERROR, "xattrop failed " + "for %s: %s", loc->path, strerror (-ret)); goto out; } @@ -2949,15 +2927,12 @@ mq_start_quota_txn_v2 (xlator_t *this, loc_t *loc, quota_inode_ctx_t *ctx, dirty = _gf_true; ret = mq_update_contri (this, &child_loc, contri, &delta); - if (ret < 0) { - gf_log (this->name, GF_LOG_ERROR, "contri " - "update failed for %s", child_loc.path); + if (ret < 0) goto out; - } ret = mq_update_size (this, &parent_loc, &delta); if (ret < 0) { - gf_log (this->name, GF_LOG_WARNING, "rollback " + gf_log (this->name, GF_LOG_DEBUG, "rollback " "contri updation"); mq_sub_meta (&delta, NULL); mq_update_contri (this, &child_loc, contri, &delta); |