Btrfs: stop mounting the fs if the non-ENOENT errors happen when opening seed fs
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 3 Sep 2014 13:35:45 +0000 (21:35 +0800)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:38:47 +0000 (13:38 -0700)
When we open a seed filesystem, if the degraded mount option is set, we continue to
mount the fs if we don't find some devices in the seed filesystem. But we should stop
mounting if other errors happen. Fix it

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/volumes.c

index 2e078fa705a6d934d6a14cf33b12c82fbaf39500..fbe4ead7e22f36287b4cd30de52cb0b506353106 100644 (file)
@@ -6093,7 +6093,7 @@ static int read_one_dev(struct btrfs_root *root,
 
        if (memcmp(fs_uuid, root->fs_info->fsid, BTRFS_UUID_SIZE)) {
                ret = open_seed_devices(root, fs_uuid);
-               if (ret && !btrfs_test_opt(root, DEGRADED))
+               if (ret && !(ret == -ENOENT && btrfs_test_opt(root, DEGRADED)))
                        return ret;
        }