Btrfs: get rid of one BUG() in write_all_supers()
authorStefan Behrens <sbehrens@giantdisaster.de>
Fri, 9 Aug 2013 15:08:40 +0000 (17:08 +0200)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:16:28 +0000 (08:16 -0400)
The second round uses btrfs_error() and return -EIO, the first round
can handle write errors the same way.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/disk-io.c

index 6d642e487229c8fbc3ea4aa5cb7433fd507f7c4a..0f75a01f69e2e3e39f791696b7289f25e8e87b54 100644 (file)
@@ -3416,8 +3416,10 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors)
                printk(KERN_ERR "btrfs: %d errors while writing supers\n",
                       total_errors);
 
-               /* This shouldn't happen. FUA is masked off if unsupported */
-               BUG();
+               /* FUA is masked off if unsupported and can't be the reason */
+               btrfs_error(root->fs_info, -EIO,
+                           "%d errors while writing supers", total_errors);
+               return -EIO;
        }
 
        total_errors = 0;