From e741983b740a26634b8d371521da2f668ec8e584 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 8 Aug 2012 07:44:43 -0400 Subject: 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 Reviewed-on: http://review.gluster.com/3789 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/stripe/src/stripe.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 7e711e9e91d..d0542d143a7 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) { -- cgit