From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 2/3] Btrfs: do not merge rbios if their fail stripe index are not identical
Date: Mon, 4 Dec 2017 15:40:36 -0700 [thread overview]
Message-ID: <20171204224037.7556-3-bo.li.liu@oracle.com> (raw)
In-Reply-To: <20171204224037.7556-1-bo.li.liu@oracle.com>
Since fail stripe index in rbio would be used to decide which
algorithm reconstruction would be run, we cannot merge rbios if
their's fail striped index are different, otherwise, one of the two
reconstructions would fail.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
fs/btrfs/raid56.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index c4188fb..8d09535 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -601,6 +601,15 @@ static int rbio_can_merge(struct btrfs_raid_bio *last,
if (last->operation == BTRFS_RBIO_REBUILD_MISSING)
return 0;
+ if (last->operation == BTRFS_RBIO_READ_REBUILD) {
+ int fa = (last->faila < last->failb) ? last->faila : last->failb;
+ int fb = (last->faila < last->failb) ? last->failb : last->faila;
+ int cur_fa = (cur->faila < cur->failb) ? cur->faila : cur->failb;
+ int cur_fb = (cur->faila < cur->failb) ? cur->failb : cur->faila;
+
+ if (fa != cur_fa || fb != cur_fb)
+ return 0;
+ }
return 1;
}
--
2.9.4
next prev parent reply other threads:[~2017-12-05 1:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 22:40 [PATCH 0/3] Btrfs: loop retry on raid6 read failures Liu Bo
2017-12-04 22:40 ` [PATCH 1/3] Btrfs: remove redundant check in rbio_can_merge Liu Bo
2017-12-05 18:20 ` David Sterba
2017-12-04 22:40 ` Liu Bo [this message]
2017-12-05 18:24 ` [PATCH 2/3] Btrfs: do not merge rbios if their fail stripe index are not identical David Sterba
2017-12-04 22:40 ` [PATCH 3/3] Btrfs: make raid6 rebuild retry more Liu Bo
2017-12-05 8:07 ` Qu Wenruo
2017-12-05 18:04 ` Liu Bo
2017-12-05 19:29 ` David Sterba
2017-12-05 18:09 ` David Sterba
2017-12-05 22:55 ` Liu Bo
2017-12-06 0:11 ` Qu Wenruo
2017-12-07 0:26 ` Liu Bo
2017-12-05 8:08 ` Qu Wenruo
2017-12-05 18:26 ` [PATCH 0/3] Btrfs: loop retry on raid6 read failures David Sterba
2018-01-05 15:54 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171204224037.7556-3-bo.li.liu@oracle.com \
--to=bo.li.liu@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).