Btrfs: skip submitting barrier for missing device
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Wed, 5 Feb 2014 07:34:38 +0000 (16:34 +0900)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 Apr 2014 15:23:21 +0000 (16:23 +0100)
commitb58d5a52ea4a3fec497594d642ed7cec25950900
tree24905a3ec4ebd512e357d0cf4b7a792afedd9ecf
parentde12340b331f5da8b78edba6d3cde42de259ee60
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: Ben Hutchings <ben@decadent.org.uk>
fs/btrfs/disk-io.c