aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>2014-02-05 02:34:38 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-26 20:15:35 -0400
commit19fc37ed7b9e8cdde28597adb9714d6f863985b4 (patch)
treef104d79d4ce43c92ab0a34f74909d98ed803fa59 /fs/btrfs
parentbf0972039ddc483a9cb79edae73076c635876568 (diff)
Btrfs: skip submitting barrier for missing device
commit f88ba6a2a44ee98e8d59654463dc157bb6d13c43 upstream. 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> Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs')
-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 b8b60b660c8f..4354b9127713 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3161,6 +3161,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
3161 /* send down all the barriers */ 3161 /* send down all the barriers */
3162 head = &info->fs_devices->devices; 3162 head = &info->fs_devices->devices;
3163 list_for_each_entry_rcu(dev, head, dev_list) { 3163 list_for_each_entry_rcu(dev, head, dev_list) {
3164 if (dev->missing)
3165 continue;
3164 if (!dev->bdev) { 3166 if (!dev->bdev) {
3165 errors_send++; 3167 errors_send++;
3166 continue; 3168 continue;
@@ -3175,6 +3177,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
3175 3177
3176 /* wait for all the barriers */ 3178 /* wait for all the barriers */
3177 list_for_each_entry_rcu(dev, head, dev_list) { 3179 list_for_each_entry_rcu(dev, head, dev_list) {
3180 if (dev->missing)
3181 continue;
3178 if (!dev->bdev) { 3182 if (!dev->bdev) {
3179 errors_wait++; 3183 errors_wait++;
3180 continue; 3184 continue;