From c530352ff2f5dc96631154f2b9a193d99cedd9bc Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Mon, 9 Jul 2018 15:10:04 +0530 Subject: afr: don't update readables if inode refresh failed on all children Backport of: https://review.gluster.org/#/c/20029/ 3.12 still supports quorum-reads, hence modified afr_inode_refresh_done() to support that. If inode refresh failed on all children of afr due to ENOENT (say file migrated by dht), it resets the readables to zero. Any inflight txn which then later comes on the inode fails with EIO because no readable children present for the inode. Fix: Don't update readables when inode refresh fails on *all* children of afr. In that way any inflight txns will either proceed with its own inode refresh if needed and fail it with the right errno or use the old value of readables and continue with the txn. Also, add quorum checks to the beginning of afr_transaction(). Otherwise, we seem to be winding the lock and checking for quorum only in pre-op pahse. Note: This should ideally fix BZ 1329505 since the stop gap fix for it is has been reverted at https://review.gluster.org/#/c/20028. Change-Id: I82990769f01be918a073fec83fc67ba4b3be24b1 BUG: 1599247 Signed-off-by: Ravishankar N --- xlators/cluster/afr/src/afr-open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/cluster/afr/src/afr-open.c') diff --git a/xlators/cluster/afr/src/afr-open.c b/xlators/cluster/afr/src/afr-open.c index 6c625ccf7da..70dc4928044 100644 --- a/xlators/cluster/afr/src/afr-open.c +++ b/xlators/cluster/afr/src/afr-open.c @@ -123,7 +123,7 @@ afr_open_continue (call_frame_t *frame, xlator_t *this, int err) priv = this->private; if (err) { - AFR_STACK_UNWIND (open, frame, -1, -err, NULL, NULL); + AFR_STACK_UNWIND (open, frame, -1, err, NULL, NULL); } else { local->call_count = AFR_COUNT (local->child_up, priv->child_count); -- cgit