Rebuild on missing device is as same as recover, after it's done, rbio
has data which is consistent with on-disk data, so it can be cached to
avoid further reads.

Signed-off-by: Liu Bo <bo.li....@oracle.com>
---
 fs/btrfs/raid56.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index dec0907..bb8a3c5 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -1986,7 +1986,8 @@ static void __raid_recover_end_io(struct btrfs_raid_bio 
*rbio)
        kfree(pointers);
 
 cleanup_io:
-       if (rbio->operation == BTRFS_RBIO_READ_REBUILD) {
+       if (rbio->operation == BTRFS_RBIO_READ_REBUILD ||
+           rbio->operation == BTRFS_RBIO_REBUILD_MISSING) {
                /*
                 * - In case of two failures, where rbio->failb != -1:
                 *
@@ -2008,8 +2009,6 @@ static void __raid_recover_end_io(struct btrfs_raid_bio 
*rbio)
                        clear_bit(RBIO_CACHE_READY_BIT, &rbio->flags);
 
                rbio_orig_end_io(rbio, err);
-       } else if (rbio->operation == BTRFS_RBIO_REBUILD_MISSING) {
-               rbio_orig_end_io(rbio, err);
        } else if (err == BLK_STS_OK) {
                rbio->faila = -1;
                rbio->failb = -1;
-- 
2.9.4

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

Reply via email to