aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/raid56.c
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2016-07-29 13:57:55 -0400
committerDavid Sterba <dsterba@suse.com>2016-09-26 11:59:49 -0400
commite46a28ca3d0dce8d939b10d4c94eaa2307b6415a (patch)
treee6b24762fac0357116bc65db4f71557b162ce649 /fs/btrfs/raid56.c
parentafce772e87c36c7f07f230a76d525025aaf09e41 (diff)
Btrfs: remove BUG() in raid56
This BUG() has been triggered by a fuzz testing image, which contains an invalid chunk type, ie. a single stripe chunk has the raid6 type. Btrfs can handle this gracefully by returning -EIO, so besides using btrfs_warn to give us more debugging information rather than a single BUG(), we can return error properly. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/raid56.c')
-rw-r--r--fs/btrfs/raid56.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index cd8d302a1f61..d016d4a79864 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -2143,7 +2143,10 @@ int raid56_parity_recover(struct btrfs_root *root, struct bio *bio,
2143 2143
2144 rbio->faila = find_logical_bio_stripe(rbio, bio); 2144 rbio->faila = find_logical_bio_stripe(rbio, bio);
2145 if (rbio->faila == -1) { 2145 if (rbio->faila == -1) {
2146 BUG(); 2146 btrfs_warn(root->fs_info,
2147 "%s could not find the bad stripe in raid56 so that we cannot recover any more (bio has logical %llu len %llu, bbio has map_type %llu)",
2148 __func__, (u64)bio->bi_iter.bi_sector << 9,
2149 (u64)bio->bi_iter.bi_size, bbio->map_type);
2147 if (generic_io) 2150 if (generic_io)
2148 btrfs_put_bbio(bbio); 2151 btrfs_put_bbio(bbio);
2149 kfree(rbio); 2152 kfree(rbio);