summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>2014-02-05 02:34:38 -0500
committerJosef Bacik <jbacik@fb.com>2014-03-10 15:15:53 -0400
commitf88ba6a2a44ee98e8d59654463dc157bb6d13c43 (patch)
treeacaa54b48346b05a918041ddfd500417123b2cc5 /fs/btrfs/disk-io.c
parent29bce2f3997a8dc5195b7a7724362d1e55df7bb2 (diff)
Btrfs: skip submitting barrier for missing device
I got an error on v3.13: BTRFS error (device sdf1) in write_all_supers:3378: errno=-5 IO failure (errors while submitting device barriers.) how to reproduce: > mkfs.btrfs -f -d raid1 /dev/sdf1 /dev/sdf2 > wipefs -a /dev/sdf2 > mount -o degraded /dev/sdf1 /mnt > btrfs balance start -f -sconvert=single -mconvert=single -dconvert=single /mnt The reason of the error is that barrier_all_devices() failed to submit barrier to the missing device. However it is clear that we cannot do anything on missing device, and also it is not necessary to care chunks on the missing device. This patch stops sending/waiting barrier if device is missing. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Cc: <stable@vger.kernel.org> Signed-off-by: Josef Bacik <jbacik@fb.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 0cafacb07b43..74c9be89fc0c 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3256,6 +3256,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
3256 /* send down all the barriers */ 3256 /* send down all the barriers */
3257 head = &info->fs_devices->devices; 3257 head = &info->fs_devices->devices;
3258 list_for_each_entry_rcu(dev, head, dev_list) { 3258 list_for_each_entry_rcu(dev, head, dev_list) {
3259 if (dev->missing)
3260 continue;
3259 if (!dev->bdev) { 3261 if (!dev->bdev) {
3260 errors_send++; 3262 errors_send++;
3261 continue; 3263 continue;
@@ -3270,6 +3272,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
3270 3272
3271 /* wait for all the barriers */ 3273 /* wait for all the barriers */
3272 list_for_each_entry_rcu(dev, head, dev_list) { 3274 list_for_each_entry_rcu(dev, head, dev_list) {
3275 if (dev->missing)
3276 continue;
3273 if (!dev->bdev) { 3277 if (!dev->bdev) {
3274 errors_wait++; 3278 errors_wait++;
3275 continue; 3279 continue;