From: Ilya Dryomov Date: Thu, 10 Oct 2013 17:37:29 +0000 (+0300) Subject: Btrfs: nuke a bogus rw_devices decrement in __btrfs_close_devices X-Git-Tag: v3.13-rc1~85^2~52 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f747cab7b75ba298df3ac234de9f1655957786cc;p=pandora-kernel.git Btrfs: nuke a bogus rw_devices decrement in __btrfs_close_devices On mount failures, __btrfs_close_devices can be called well before dev-replace state is read and ->is_tgtdev_for_dev_replace is set. This leads to a bogus decrement of ->rw_devices and sets off a WARN_ON in __btrfs_close_devices if replace target device happens to be on the lists and we fail early in the mount sequence. Fix this by checking the devid instead of ->is_tgtdev_for_dev_replace before the decrement: for replace targets devid is always equal to BTRFS_DEV_REPLACE_DEVID. Cc: Stefan Behrens Signed-off-by: Ilya Dryomov Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- Reading git-diff-tree failed