Skip to content

Commit

Permalink
Btrfs: fix wrong missing device counter decrease
Browse files Browse the repository at this point in the history
The missing devices are accounted by its own fs device, for example
the missing devices in seed filesystem will be accounted by the fs device
of the seed filesystem, not by the new filesystem which is based on
the seed filesystem, so when we remove the missing device in the
seed filesystem, we should decrease the counter of its own fs device.
Fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
Miao Xie authored and Chris Mason committed Aug 19, 2014
1 parent 69611ac commit 3a7d55c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
device->fs_devices->total_devices--;

if (device->missing)
root->fs_info->fs_devices->missing_devices--;
device->fs_devices->missing_devices--;

next_device = list_entry(root->fs_info->fs_devices->devices.next,
struct btrfs_device, dev_list);
Expand Down

0 comments on commit 3a7d55c

Please sign in to comment.