]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix BUG() in scrub when first superblock reading gives EIO
authorStefan Behrens <sbehrens@giantdisaster.de>
Wed, 14 Nov 2012 18:57:29 +0000 (18:57 +0000)
committerChris Mason <chris.mason@fusionio.com>
Mon, 17 Dec 2012 01:46:28 +0000 (20:46 -0500)
commit461ce01261cc5e1272de74eb2934b3ab5613a1f0
treee3b4f6247ce96801b8085b5ba787901eac5a2973
parent0e02b8fe5a814ac6f2f92a694a1b141fad4a085f
Btrfs: fix BUG() in scrub when first superblock reading gives EIO

This fixes a very special case that can be reproduced by just
disconnecting a disk at runtime, and without unmounting the
filesystem first, start scrub on the filesystem with the
disconnected disk. All read and write EIOs are handled
correctly, only the first superblock is an exception and gives
a BUG() in a subfunction. The BUG() is correct, it would crash
later otherwise. The subfunction must not be called for
superblocks and this is what the fix changes.

Reported-by: Joeri Vanthienen <mail@joerivanthienen.be>
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/scrub.c