From 67b33479a3423ccff4b6ccf21636d8bd036f8dd6 Mon Sep 17 00:00:00 2001
From: Pranith Kumar K <pkarampu@redhat.com>
Date: Sun, 12 Jul 2015 18:37:43 +0530
Subject: [PATCH 235/244] cluster/ec: Propogate correct errno in case of failures
Backport of http://review.gluster.com/11639
- Also remove internal-fop setting in create/mknod etc xattrs.
Rebalance was failing because ec was giving EIO when lock acquiring fails as
the file/dir doesn't exist. Posix_create/mknod are not setting config xattr
because internal-fop key is present in dict and setxattr for this fails leading
to failure in setting rest of xattrs.
Change-Id: Ifb429c8db9df7cd51e4f8ce53fdf1e1b975c9993
BUG: 1240617
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/52918
---
xlators/cluster/ec/src/ec-locks.c | 5 ++++-
xlators/storage/posix/src/posix-helpers.c | 3 +++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/xlators/cluster/ec/src/ec-locks.c b/xlators/cluster/ec/src/ec-locks.c
index dd79514..9c41e11 100644
--- a/xlators/cluster/ec/src/ec-locks.c
+++ b/xlators/cluster/ec/src/ec-locks.c
@@ -77,7 +77,10 @@ int32_t ec_lock_check(ec_fop_data_t *fop, uintptr_t *mask)
}
}
} else {
- error = EIO;
+ if (fop->answer && fop->answer->op_ret < 0)
+ error = fop->answer->op_errno;
+ else
+ error = EIO;
}
}
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index e2c5eb2..cae56e7 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -69,6 +69,8 @@ static char* posix_ignore_xattrs[] = {
GLUSTERFS_POSIXLK_COUNT,
GLUSTERFS_PARENT_ENTRYLK,
GF_GFIDLESS_LOOKUP,
+ GLUSTERFS_INODELK_DOM_COUNT,
+ GLUSTERFS_INTERNAL_FOP_KEY,
NULL
};
@@ -1517,6 +1519,7 @@ _handle_entry_create_keyvalue_pair (dict_t *d, char *k, data_t *v,
!strcmp ("gfid-req", k) ||
!strcmp (POSIX_ACL_DEFAULT_XATTR, k) ||
!strcmp (POSIX_ACL_ACCESS_XATTR, k) ||
+ posix_xattr_ignorable (k) ||
ZR_FILE_CONTENT_REQUEST(k)) {
return 0;
}
--
1.7.1