From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com,
Qu Wenruo <wqu@suse.com>
Subject: Re: [PATCH v2 5/5] btrfs: introduce rescue=all
Date: Tue, 29 Sep 2020 16:55:28 +0200 [thread overview]
Message-ID: <20200929145527.GG6756@twin.jikos.cz> (raw)
In-Reply-To: <b3975f6ad0362885ffd7ff8ff53e7861a316515a.1601318001.git.josef@toxicpanda.com>
On Mon, Sep 28, 2020 at 02:34:57PM -0400, Josef Bacik wrote:
> Now that we have the building blocks for some better recovery options
> with corrupted file systems, add a rescue=all option to enable all of
> the relevant rescue options. This will allow distro's to simply default
> to rescue=all for the "oh dear lord the world's on fire" recovery
> without needing to know all the different options that we have and may
> add in the future.
>
> Reviewed-by: Qu Wenruo <wqu@suse.com>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
> fs/btrfs/super.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 2282f0240c1d..3412763a9a0d 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -362,6 +362,7 @@ enum {
> Opt_nologreplay,
> Opt_ignorebadroots,
> Opt_ignoredatacsums,
> + Opt_all,
>
> /* Deprecated options */
> Opt_recovery,
> @@ -459,6 +460,7 @@ static const match_table_t rescue_tokens = {
> {Opt_nologreplay, "nologreplay"},
> {Opt_ignorebadroots, "ignorebadroots"},
> {Opt_ignoredatacsums, "ignoredatacsums"},
> + {Opt_all, "all"},
> {Opt_err, NULL},
> };
>
> @@ -510,6 +512,12 @@ static int parse_rescue_options(struct btrfs_fs_info *info, const char *options)
> btrfs_set_and_info(info, IGNOREDATACSUMS,
> "ignoring data csums");
> break;
> + case Opt_all:
> + btrfs_set_opt(info->mount_opt, IGNOREDATACSUMS);
> + btrfs_set_opt(info->mount_opt, IGNOREBADROOTS);
> + btrfs_set_opt(info->mount_opt, NOLOGREPLAY);
> + btrfs_info(info, "enabling all of the rescue options");
As we're going to add more options in the future, this shoud be more
specific which ones are being enabled under 'all'.
btrfs_info(info, "enabling all default rescue options:");
btrfs_set_opt_and_info(info->mount_opt, IGNOREDATACSUMS, "descripton...");
btrfs_set_opt(info->mount_opt, IGNOREBADROOTS);
btrfs_set_opt(info->mount_opt, NOLOGREPLAY);
Also in sysfs/features we should export all supported rescue options and
which are enabled by all. That's just for user convenience so we don't
have to publish version + supported options separately.
> + break;
> case Opt_err:
> btrfs_info(info, "unrecognized rescue option '%s'", p);
> ret = -EINVAL;
> --
> 2.26.2
next prev parent reply other threads:[~2020-09-29 14:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 18:34 [PATCH v2 0/5] New rescue mount options Josef Bacik
2020-09-28 18:34 ` [PATCH v2 1/5] btrfs: unify the ro checking for " Josef Bacik
2020-09-28 18:34 ` [PATCH v2 2/5] btrfs: push the NODATASUM check into btrfs_lookup_bio_sums Josef Bacik
2020-09-28 18:34 ` [PATCH v2 3/5] btrfs: introduce rescue=ignorebadroots Josef Bacik
2020-09-28 18:34 ` [PATCH v2 4/5] btrfs: introduce rescue=ignoredatacsums Josef Bacik
2020-09-29 14:57 ` David Sterba
2020-09-28 18:34 ` [PATCH v2 5/5] btrfs: introduce rescue=all Josef Bacik
2020-09-29 14:55 ` David Sterba [this message]
2020-09-29 15:06 ` [PATCH v2 0/5] New rescue mount options David Sterba
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=20200929145527.GG6756@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.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