diff options
| author | Brian Foster <bfoster@redhat.com> | 2012-08-08 07:44:43 -0400 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2012-08-09 01:17:48 -0700 | 
| commit | e741983b740a26634b8d371521da2f668ec8e584 (patch) | |
| tree | a669aaee50dde77648705fac2481b0082c009639 | |
| parent | 0c1cee625818275dd1b3f6718bd246d2e30dabd1 (diff) | |
cluster/stripe: don't fail if no fctx on a non-regular file
cluster/stripe broke directory rename. Only check for fctx on regular
files.
BUG: 842652
Change-Id: I29d7b265cbe40921226feb3e1c4e6b97b3a01d95
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.com/3789
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
| -rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 24 | 
1 files changed, 14 insertions, 10 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 7e711e9e9..d0542d143 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -1059,10 +1059,12 @@ stripe_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,          local->call_count = priv->child_count; -	inode_ctx_get(oldloc->inode, this, (uint64_t *) &fctx); -	if (!fctx) -		goto err; -	local->fctx = fctx; +	if (IA_ISREG(oldloc->inode->ia_type)) { +		inode_ctx_get(oldloc->inode, this, (uint64_t *) &fctx); +		if (!fctx) +			goto err; +		local->fctx = fctx; +	}          frame->local = local; @@ -1949,12 +1951,14 @@ stripe_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          {                  callcnt = --local->call_count; -		inode_ctx_get(inode, this, (uint64_t *) &fctx); -		if (!fctx) { -			gf_log(this->name, GF_LOG_ERROR, "failed to get stripe " -				"context"); -			op_ret = -1; -			op_errno = EINVAL; +		if (IA_ISREG(inode->ia_type)) { +			inode_ctx_get(inode, this, (uint64_t *) &fctx); +			if (!fctx) { +				gf_log(this->name, GF_LOG_ERROR, +					"failed to get stripe context"); +				op_ret = -1; +				op_errno = EINVAL; +			}  		}                  if (op_ret == -1) {  | 
