Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Btrfs: remove misleading handling of missing device scrub

scrub_submit() claims that it can handle a bio with a NULL block device,
but this is misleading, as calling bio_add_page() on a bio with a NULL
->bi_bdev would've already crashed. Delete this, as we're about to
properly handle a missing block device.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>

authored by

Omar Sandoval and committed by
Chris Mason
03679ade 293a8489

+1 -15
+1 -15
fs/btrfs/scrub.c
··· 2096 2096 sbio = sctx->bios[sctx->curr]; 2097 2097 sctx->curr = -1; 2098 2098 scrub_pending_bio_inc(sctx); 2099 - 2100 - if (!sbio->bio->bi_bdev) { 2101 - /* 2102 - * this case should not happen. If btrfs_map_block() is 2103 - * wrong, it could happen for dev-replace operations on 2104 - * missing devices when no mirrors are available, but in 2105 - * this case it should already fail the mount. 2106 - * This case is handled correctly (but _very_ slowly). 2107 - */ 2108 - printk_ratelimited(KERN_WARNING 2109 - "BTRFS: scrub_submit(bio bdev == NULL) is unexpected!\n"); 2110 - bio_endio(sbio->bio, -EIO); 2111 - } else { 2112 - btrfsic_submit_bio(READ, sbio->bio); 2113 - } 2099 + btrfsic_submit_bio(READ, sbio->bio); 2114 2100 } 2115 2101 2116 2102 static int scrub_add_page_to_rd_bio(struct scrub_ctx *sctx,