]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix the race between reading and updating devices
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Wed, 20 Apr 2011 10:07:30 +0000 (10:07 +0000)
committerChris Mason <chris.mason@oracle.com>
Mon, 23 May 2011 17:24:42 +0000 (13:24 -0400)
commit909facce6503509c9788371f0bc1133aa06d6674
tree6b34bd7cdf5dcd882e61bf4912ae10b4de3b87dd
parentb35add894315cc7a5577c27355b5de1f01464d85
Btrfs: fix the race between reading and updating devices

On btrfs_congested_fn and __unplug_io_fn paths, we should hold
device_list_mutex to avoid remove/add device path to
update fs_devices->devices

On __btrfs_close_devices and btrfs_prepare_sprout paths, the devices in
fs_devices->devices or fs_devices->devices is updated, so we should hold
the mutex to avoid the reader side to reach them

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c
fs/btrfs/volumes.c