summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-transaction.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2015-06-25 00:22:41 +0530
committerVijay Bellur <vbellur@redhat.com>2015-06-26 19:32:16 -0700
commit47a19340a72ccc06c946c0f2c84c601de81999be (patch)
treee26543e36a6e30ede690ea00c7e7f4833f9ec0dc /xlators/cluster/afr/src/afr-transaction.c
parent39db0991a166acfee83e184e0ea8e2883e43a953 (diff)
afr: Block fops when file is in split-brain
Backport of http://review.gluster.org/#/c/11371/ For directories, block metadata FOPS. For non-directories, block data and metadata FOPS. Do not block entry FOPS. Change-Id: I23963648291ec1136a5a35052ed0b7bc1b3059e7 BUG: 1235934 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/11420 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-transaction.c')
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index a2023884465..b27cfedaddb 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -1967,6 +1967,13 @@ afr_transaction (call_frame_t *frame, xlator_t *this, afr_transaction_type type)
if (ret < 0)
goto out;
+ ret = afr_inode_get_readable (frame, local->inode, this, 0, 0, type);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, EIO, AFR_MSG_SPLIT_BRAIN,
+ "Failing %s on gfid %s: split-brain observed.",
+ gf_fop_list[local->op], uuid_utoa (local->inode->gfid));
+ goto out;
+ }
afr_transaction_eager_lock_init (local, this);
if (local->fd && local->transaction.eager_lock_on)