From: "Darrick J. Wong" <djwong@kernel.org>
To: Anand Jain <anand.jain@oracle.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
zlang@redhat.com, ddiss@suse.de
Subject: Re: [PATCH] fstests: use btrfs check repair for repairing btrfs filesystems
Date: Fri, 18 Aug 2023 08:13:46 -0700 [thread overview]
Message-ID: <20230818151346.GR11340@frogsfrogsfrogs> (raw)
In-Reply-To: <2c89e68e7a34f1d0545f19e9e178e258f777c027.1692286458.git.anand.jain@oracle.com>
On Thu, Aug 17, 2023 at 11:40:04PM +0800, Anand Jain wrote:
> There are two repair functions: _repair_scratch_fs() and
> _repair_test_fs(). As the names suggest, these functions are designed to
> repair the filesystems SCRATCH_DEV and TEST_DEV, respectively. However,
> these functions never called proper comamnd for the filesystem type btrfs.
> This patch fixes it. Thx.
Heh. This sounds like a good improvement. :)
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> common/rc | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index 66d270acf069..49effbf760c0 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1177,6 +1177,15 @@ _repair_scratch_fs()
> fi
> return $res
> ;;
> + btrfs)
> + echo "btrfs check --repair --force $SCRATCH_DEV"
> + btrfs check --repair --force $SCRATCH_DEV 2>&1
Should you allow callers of _repair_{test,scratch}_fs to pass in
arguments?
--D
> + local res=$?
> + if [ $res -ne 0 ]; then
> + _dump_err2 "btrfs repair failed, err=$res"
> + fi
> + return $res
> + ;;
> bcachefs)
> # With bcachefs, if fsck detects any errors we consider it a bug and we
> # want the test to fail:
> @@ -1229,6 +1238,11 @@ _repair_test_fs()
> res=$?
> fi
> ;;
> + btrfs)
> + echo 'btrfs check --repair --force "$@"' > /tmp.repair 2>&1
> + btrfs check --repair --force "$@" >> /tmp.repair 2>&1
> + res=$?
> + ;;
> *)
> # Let's hope fsck -y suffices...
> fsck -t $FSTYP -y $TEST_DEV >$tmp.repair 2>&1
> --
> 2.39.3
>
next prev parent reply other threads:[~2023-08-18 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 15:40 [PATCH] fstests: use btrfs check repair for repairing btrfs filesystems Anand Jain
2023-08-18 15:13 ` Darrick J. Wong [this message]
2023-08-21 7:47 ` Anand Jain
2023-08-21 9:05 ` [PATCH v2] " Anand Jain
2023-09-13 17:06 ` Zorro Lang
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=20230818151346.GR11340@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=anand.jain@oracle.com \
--cc=ddiss@suse.de \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=zlang@redhat.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;
as well as URLs for NNTP newsgroup(s).