diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2013-02-19 13:22:25 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-02-19 16:06:28 -0800 |
commit | b371736a58a3c0174fbd8823d51c690ec9d4f7d3 (patch) | |
tree | c9c7ef988001f193bf05cca51ea51214d836f329 /xlators/cluster/afr/src/afr-inode-read.c | |
parent | fd407a4f5cdb869dc52efe8fc9e1d284f60f5992 (diff) | |
download | glusterfs-b371736a58a3c0174fbd8823d51c690ec9d4f7d3.tar.gz glusterfs-b371736a58a3c0174fbd8823d51c690ec9d4f7d3.tar.xz glusterfs-b371736a58a3c0174fbd8823d51c690ec9d4f7d3.zip |
cluster/afr: do complete split-brain check in all the fd based fops
fd based operations such as readv checked only for data split brain
instead of complete split-brain (i.e both data + metadata) assuming that
open would have done the complete split-brain check. However open-behind
would have unwound open, without winding to afr thus preventing the complete
split-brain check and some appliations will be able to read the contents
of the file even though the file has metadata split-brain. So let all
the fd based fops do a defensive check of complete split-brain.
Change-Id: Ia90b35f2b08426dfcad804b7f8105278c86fbd2d
BUG: 846240
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/4548
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-read.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-read.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index 40d57b6f9d..1263749b7f 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -348,6 +348,11 @@ afr_fstat (call_frame_t *frame, xlator_t *this, VALIDATE_OR_GOTO (fd->inode, out); + if (afr_is_split_brain (this, fd->inode)) { + op_errno = EIO; + goto out; + } + AFR_LOCAL_ALLOC_OR_GOTO (frame->local, out); local = frame->local; @@ -1658,6 +1663,10 @@ afr_fgetxattr (call_frame_t *frame, xlator_t *this, children = priv->children; + if (afr_is_split_brain (this, fd->inode)) { + op_errno = EIO; + goto out; + } AFR_LOCAL_ALLOC_OR_GOTO (local, out); frame->local = local; @@ -1813,7 +1822,7 @@ afr_readv (call_frame_t *frame, xlator_t *this, priv = this->private; children = priv->children; - if (afr_is_data_split_brain (this, fd->inode)) { + if (afr_is_split_brain (this, fd->inode)) { op_errno = EIO; goto out; } |