From: Zhao Lei <[email protected]>

Current code of page level repair for dev-replace can only support
io-error, we can't use it in checksum-fail case.

We can skip this kind of repair in dev-replace just as we in scrub.

Signed-off-by: Zhao Lei <[email protected]>
Signed-off-by: Miao Xie <[email protected]>
---
 fs/btrfs/scrub.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 22779dd..8d6c29a 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -1099,6 +1099,10 @@ nodatasum_case:
                }
        }
 
+       /* can only fix I/O errors from here on */
+       if (sblock_bad->no_io_error_seen)
+               goto did_not_correct_error;
+
        /*
         * for dev_replace, pick good pages and write to the target device.
         */
@@ -1181,10 +1185,6 @@ nodatasum_case:
         * area are unreadable.
         */
 
-       /* can only fix I/O errors from here on */
-       if (sblock_bad->no_io_error_seen)
-               goto did_not_correct_error;
-
        success = 1;
        for (page_num = 0; page_num < sblock_bad->page_count; page_num++) {
                struct scrub_page *page_bad = sblock_bad->pagev[page_num];
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to