diff options
| author | Junaid <junaid@gluster.com> | 2011-09-30 12:15:17 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vijay@gluster.com> | 2011-10-06 22:42:15 -0700 | 
| commit | f8959749d26de4b13774e04ba4d01d799dc1c725 (patch) | |
| tree | 566dbd70386353ce7d6d33cc104af790eaed0481 | |
| parent | 78dd69c4c732d3d74070118f0b6b708264d8fc0c (diff) | |
features/marker-quota: Return error when inode-contribution is not present in inode_ctx.
Also, create the inode_contribution node even before checking for dirty and xattr not present in mq_inspect_directory_xattr function.
Change-Id: Ie5b6e6ba8d5abcfc6aeb9b192720ac10aac1319e
BUG: 3624
Reviewed-on: http://review.gluster.com/539
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
| -rw-r--r-- | xlators/features/marker/src/marker-quota.c | 26 | 
1 files changed, 16 insertions, 10 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 0d2eb9e71b3..81dbfbd0905 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -1208,6 +1208,8 @@ mq_get_parent_inode_local (xlator_t *this, quota_local_t *local)          GF_VALIDATE_OR_GOTO ("marker", this, out);          GF_VALIDATE_OR_GOTO ("marker", local, out); +        local->contri = NULL; +          loc_wipe (&local->loc);          ret = mq_loc_copy (&local->loc, &local->parent_loc); @@ -1241,6 +1243,7 @@ mq_get_parent_inode_local (xlator_t *this, quota_local_t *local)                  gf_log_callingfn (this->name, GF_LOG_WARNING,                          "contribution node list is empty which "                          "is an error"); +                ret = -1;                  goto out;          } @@ -1970,7 +1973,17 @@ mq_inspect_directory_xattr (xlator_t *this,                          gf_log (this->name, GF_LOG_WARNING,                                  "mq_inode_ctx_new failed");                          ret = -1; -                        goto out; +                        goto err; +                } +        } + +        if (strcmp (loc->path, "/") != 0) { +                contribution = mq_add_new_contribution_node (this, ctx, loc); +                if (contribution == NULL) { +                        gf_log (this->name, GF_LOG_WARNING, +                                "cannot add a new contribution node"); +                        ret = -1; +                        goto err;                  }          } @@ -1985,13 +1998,6 @@ mq_inspect_directory_xattr (xlator_t *this,          if (strcmp (loc->path, "/") != 0) {                  not_root = _gf_true; -                contribution = mq_add_new_contribution_node (this, ctx, loc); -                if (contribution == NULL) { -                        gf_log (this->name, GF_LOG_DEBUG, -                                "cannot add a new contributio node"); -                        goto out; -                } -                  GET_CONTRI_KEY (contri_key, contribution->gfid, ret);                  if (ret < 0)                          goto out; @@ -2032,8 +2038,8 @@ mq_inspect_directory_xattr (xlator_t *this,  out:          if (ret)                  mq_set_inode_xattr (this, loc); - -        return 0; +err: +        return ret;  }  int32_t  | 
