From: Miao Xie Date: Wed, 3 Sep 2014 13:35:45 +0000 (+0800) Subject: Btrfs: stop mounting the fs if the non-ENOENT errors happen when opening seed fs X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=416d7b802a8bc044e98dc8bd96b59ce7a02287ac;p=openwrt%2Fstaging%2Fblogic.git Btrfs: stop mounting the fs if the non-ENOENT errors happen when opening seed fs 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 Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2e078fa705a6..fbe4ead7e22f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -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; }