From: "Darrick J. Wong" <djwong@kernel.org>
To: Filipe Manana <fdmanana@kernel.org>, Zorro Lang <zlang@redhat.com>
Cc: Anand Jain <anand.jain@oracle.com>,
fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption
Date: Thu, 20 Feb 2025 20:18:19 -0800 [thread overview]
Message-ID: <20250221041819.GX21799@frogsfrogsfrogs> (raw)
In-Reply-To: <CAL3q7H6cH26jarU+YEogd5O5FuHi+YNtaWgmsV72NuXacPQU6w@mail.gmail.com>
On Thu, Feb 20, 2025 at 06:22:57PM +0000, Filipe Manana wrote:
> On Thu, Feb 20, 2025 at 5:03 PM Darrick J. Wong <djwong@kernel.org> wrote:
> >
> > On Thu, Feb 20, 2025 at 01:27:32PM +0800, Anand Jain wrote:
> > > On 20/2/25 02:19, fdmanana@kernel.org wrote:
> > > > From: Filipe Manana <fdmanana@suse.com>
> > > >
> > > > If the test fails or is interrupted after mounting $scratch_dev3 inside
> > > > the test filesystem and before unmounting at test_add_device(), we leave
> > > > without being unable to unmount the test filesystem since it has a mount
> > > > inside it. This results in the need to manually unmount $scratch_dev3,
> > > > otherwise a subsequent run of fstests fails since the unmount of the
> > > > test device fails with -EBUSY.
> > > >
> > > > Fix this by unmounting $scratch_dev3 ($seq_mnt) in the _cleanup()
> > > > function.
> > > >
> > > > Signed-off-by: Filipe Manana <fdmanana@suse.com>
> > > > ---
> > > > tests/btrfs/254 | 1 +
> > > > 1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/tests/btrfs/254 b/tests/btrfs/254
> > > > index d9c9eea9..6523389b 100755
> > > > --- a/tests/btrfs/254
> > > > +++ b/tests/btrfs/254
> > > > @@ -21,6 +21,7 @@ _cleanup()
> > > > {
> > > > cd /
> > > > rm -f $tmp.*
> > > > + $UMOUNT_PROG $seq_mnt > /dev/null 2>&1
> >
> > This should use the _unmount helper that's in for-next.
>
> Sure, it does the same, except that it redirects stdout and stderr to
> $seqres.full.
>
> Some tests are still calling $UMOUNT_PROG directly. And that's often
> what we want, so that if umount fails we get a mismatch with the
> golden output instead of ignoring the failure.
> But in this case it's fine.
<groan> You're right, I'd repressed that Chinner decided to introduce
_unmount so that he could improve logging of unmount failures but then
he only bothered converting tests/{generic,xfs} because he didn't give
a damn about anyone else.
Now fstests is stuck with a half finished conversion and no clarity
about whether the rest of the $UMOUNT_PROG invocations should be
converted to _umount or if those are somehow intentional.
Hey Zorro, do you have any opinion on this? Should someone just finish
the $UMOUNT_PROG -> _unmount conversion next week?
--D
> Anand, since you've already merged this patch into your repo, can you
> please replace that line with the following?
>
> _unmount $seq_mnt
>
> Thanks.
>
> >
> > --D
> >
> > > > rm -rf $seq_mnt > /dev/null 2>&1
> > > > cleanup_dmdev
> > > > }
> > >
> > >
> > > Reviewed-by: Anand Jain <anand.jain@oracle.com>
> > >
> > >
> > >
>
next prev parent reply other threads:[~2025-02-21 4:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 18:19 [PATCH 0/2] fstests: a couple fixes for btrfs/254 fdmanana
2025-02-19 18:19 ` [PATCH 1/2] btrfs/254: don't leave mount on test fs in case of failure/interruption fdmanana
2025-02-20 5:27 ` Anand Jain
2025-02-20 17:03 ` Darrick J. Wong
2025-02-20 18:22 ` Filipe Manana
2025-02-21 1:48 ` Anand Jain
2025-02-21 6:09 ` Zorro Lang
2025-02-21 4:18 ` Darrick J. Wong [this message]
2025-02-21 6:02 ` Zorro Lang
2025-02-21 20:22 ` Darrick J. Wong
2025-02-25 22:19 ` [PATCH] fstests: finish UMOUNT_PROG to _unmount conversion Dave Chinner
2025-02-26 10:37 ` Filipe Manana
2025-02-26 16:16 ` Darrick J. Wong
2025-02-26 21:37 ` Dave Chinner
2025-02-19 18:19 ` [PATCH 2/2] btrfs/254: fix test failure in case scratch devices are larger than 50G fdmanana
2025-02-20 6:45 ` Anand Jain
2025-02-19 22:13 ` [PATCH 0/2] fstests: a couple fixes for btrfs/254 David Sterba
2025-02-20 6:42 ` Qu Wenruo
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=20250221041819.GX21799@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=anand.jain@oracle.com \
--cc=fdmanana@kernel.org \
--cc=fdmanana@suse.com \
--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