From: Anand Jain <anand.jain@oracle.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v7 2/2] btrfs: Introduce new mount option to skip block group items scan
Date: Fri, 5 Jun 2020 18:03:53 +0800 [thread overview]
Message-ID: <7ef6183b-4e6f-e395-acd3-29057668d304@oracle.com> (raw)
In-Reply-To: <20200604071807.61345-3-wqu@suse.com>
> @@ -2010,6 +2056,9 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info)
> int need_clear = 0;
> u64 cache_gen;
>
> + if (btrfs_test_opt(info, SKIPBG))
> + return fill_dummy_bgs(info);
> +
Could it first read the block group if it fails then check mount
option skip + other required options are set to continue/abort?
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index f8ec2d8606fd..84d62bd53940 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -2269,11 +2269,15 @@ static int btrfs_read_roots(struct btrfs_fs_info *fs_info)
>
> root = btrfs_read_tree_root(tree_root, &location);
> if (IS_ERR(root)) {
> - ret = PTR_ERR(root);
> - goto out;
> + if (!btrfs_test_opt(fs_info, SKIPBG)) {
> + ret = PTR_ERR(root);
> + goto out;
> + }
Needs a btrfs_warn().
> @@ -2215,9 +2238,12 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf)
> * not fit in the free metadata space. If we aren't ->full then we
> * still can allocate chunks and thus are fine using the currently
> * calculated f_bavail.
> + *
> + * Or if we're rescuing, set available to 0 anyway.
>
> */
> - if (!mixed && block_rsv->space_info->full &&
> - total_free_meta - thresh < block_rsv->size)
> + if (btrfs_test_opt(fs_info, SKIPBG) ||
> + (!mixed && block_rsv->space_info->full &&
> + total_free_meta - thresh < block_rsv->size))
> buf->f_bavail = 0;
>
I wonder why is this necessary? when RO and nologreply mount options
are prerequisites of the skip mount option.
Also its not a good idea that df reports 0 available size.
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 0d6e785bcb98..f89625de1fff 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -7594,6 +7594,13 @@ int btrfs_verify_dev_extents(struct btrfs_fs_info *fs_info)
> u64 prev_dev_ext_end = 0;
> int ret = 0;
>
> + /*
> + * For rescue=skipbg mount option, we're already RO and are salvaging
> + * data, no need for such strict check.
> + */
> + if (btrfs_test_opt(fs_info, SKIPBG))
> + return 0;
> +
Here too, can we first verify if the dev extents actually fail, and
then check if skip + other necessary mount options are set to
continue/abort the mount. ?
Thanks, Anand
next prev parent reply other threads:[~2020-06-05 10:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 7:18 [PATCH v7 0/2] btrfs: Introduce new rescue= mount options Qu Wenruo
2020-06-04 7:18 ` [PATCH v7 1/2] btrfs: Introduce "rescue=" mount option Qu Wenruo
2020-06-04 13:15 ` Josef Bacik
2020-06-05 10:04 ` Anand Jain
2020-06-05 11:36 ` David Sterba
2020-06-08 8:11 ` Anand Jain
2020-06-08 9:39 ` Qu Wenruo
2020-06-10 14:47 ` David Sterba
2020-06-10 15:11 ` David Sterba
2020-06-04 7:18 ` [PATCH v7 2/2] btrfs: Introduce new mount option to skip block group items scan Qu Wenruo
2020-06-04 13:17 ` Josef Bacik
2020-06-05 10:03 ` Anand Jain [this message]
2020-06-05 9:22 ` [PATCH v7 0/2] btrfs: Introduce new rescue= mount options Anand Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7ef6183b-4e6f-e395-acd3-29057668d304@oracle.com \
--to=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox