From: Josef Bacik Date: Mon, 26 Aug 2013 17:45:53 +0000 (-0400) Subject: Btrfs: adjust the fs_devices->missing count on unmount X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=726551ebc79c0a41f66376463ebe8c84c89c1151;p=linux-beck.git Btrfs: adjust the fs_devices->missing count on unmount I noticed that if I tried to mount a file system with -o degraded after having done it once already we would fail to mount. This is because the fs_devices->missing count was getting bumped everytime we mounted, but not getting reset whenever we unmounted. To fix this we just drop the missing count as we're closing devices to make sure this doesn't happen. Thanks, Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 74614e3b5ad3..f42e41290124 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -673,6 +673,8 @@ static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices) if (device->can_discard) fs_devices->num_can_discard--; + if (device->missing) + fs_devices->missing_devices--; new_device = btrfs_alloc_device(NULL, &device->devid, device->uuid);