]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: make btrfs_rm_device() fail gracefully
authorIlya Dryomov <idryomov@gmail.com>
Tue, 15 Feb 2011 18:14:25 +0000 (18:14 +0000)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Feb 2011 20:37:59 +0000 (15:37 -0500)
commit61d7b7d86ead419085544911b92df13865147f5d
treeb317f5ed612c5adae478a7acd48f6d8096a1656d
parent2f4f07f720d39ade8c28d275551c6625db478c2c
Btrfs: make btrfs_rm_device() fail gracefully

If shrinking done as part of the online device removal fails add that
device back to the allocation list and increment the rw_devices counter.
This fixes two bugs:

1) we could have a perfectly good device out of alloc list for no good
reason;

2) in the btrfs consisting of two devices, failure in btrfs_rm_device()
could lead to a situation where it was impossible to remove any of the
devices because of the "unable to remove the only writeable device"
error.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/volumes.c