From 985a1d15db910e012ddc1dcdc2e333cc28a9968b Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 18 May 2018 15:38:29 +0530 Subject: afr: fix bug-1363721.t failure Problem: In the .t, when the only good brick was brought down, writes on the fd were still succeeding on the bad bricks. The inflight split-brain check was marking the write as failure but since the write succeeded on all the bad bricks, afr_txn_nothing_failed() was set to true and we were unwinding writev with success to DHT and then catching the failure in post-op in the background. Fix: Don't wind the FOP phase if the write_subvol (which is populated with readable subvols obtained in pre-op cbk) does not have at least 1 good brick which was up when the transaction started. Note: This fix is not related to brick muliplexing. I ran the .t 10 times with this fix and brick-mux enabled without any failures. Change-Id: I915c9c366aa32cd342b1565827ca2d83cb02ae85 updates: bz#1577672 Signed-off-by: Ravishankar N --- xlators/cluster/afr/src/afr-common.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xlators/cluster/afr/src/afr-common.c') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index c313294961f..ad037cd7060 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -6631,6 +6631,20 @@ out: return ret; } +uint64_t +afr_write_subvol_get (call_frame_t *frame, xlator_t *this) +{ + afr_local_t *local = NULL; + uint64_t write_subvol = 0; + + local = frame->local; + LOCK(&local->inode->lock); + write_subvol = local->inode_ctx->write_subvol; + UNLOCK (&local->inode->lock); + + return write_subvol; +} + int afr_write_subvol_set (call_frame_t *frame, xlator_t *this) { -- cgit