summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/stripe
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2012-07-24 08:25:50 -0400
committerAnand Avati <avati@redhat.com>2012-07-25 14:55:06 -0700
commit787d52d8e8bf415e48fa41ff9c7fef4693804903 (patch)
treea08f3a99188733b6284bc6e6fca759f772c67999 /xlators/cluster/stripe
parent12516e8af663032a0e6133f5f8f62f1078f9462d (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: I8a1e7ff30d57c994082cb10471f610023713ee53 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.com/3720 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/stripe')
-rw-r--r--xlators/cluster/stripe/src/stripe.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 6a5c495b567..d17b2a9124e 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) {