From a2b85d13e50327da721e32071aecad21b10ffb1a Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 15 Nov 2012 23:07:24 +0530 Subject: cluster/afr: Fail readv on data-split-brain Problem: Afr prevents opens on a file in split-brian but the fd that is already open still has the capability to perform both reads and writes to the file. Fix: Fail readvs on a file with EIO. Change-Id: I8e07f24c36fab800499b36ab374f984b743332cd BUG: 873962 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/4199 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Anand Avati --- xlators/cluster/afr/src/afr-inode-read.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/cluster/afr/src/afr-inode-read.c') diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index 1b3f74051..40d57b6f9 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -1813,6 +1813,11 @@ afr_readv (call_frame_t *frame, xlator_t *this, priv = this->private; children = priv->children; + if (afr_is_data_split_brain (this, fd->inode)) { + op_errno = EIO; + goto out; + } + AFR_LOCAL_ALLOC_OR_GOTO (frame->local, out); local = frame->local; -- cgit