linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Chandan Babu R <chandanbabu@kernel.org>, Jan Kara <jack@suse.cz>,
	"Darrick J. Wong" <djwong@kernel.org>
Cc: viro@zeniv.linux.org.uk, axboe@kernel.dk,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	djwong@kernel.org, linux-xfs@vger.kernel.org,
	dchinner@fromorbit.com, Christoph Hellwig <hch@lst.de>
Subject: Re: [BUG REPORT] next-20231102: generic/311 fails on XFS with external log
Date: Thu, 2 Nov 2023 15:54:48 +0100	[thread overview]
Message-ID: <20231102-teich-absender-47a27e86e78f@brauner> (raw)
In-Reply-To: <87bkccnwxc.fsf@debian-BULLSEYE-live-builder-AMD64>

On Thu, Nov 02, 2023 at 06:06:10PM +0530, Chandan Babu R wrote:
> Hi,
> 
> generic/311 consistently fails when executing on a kernel built from
> next-20231102.
> 
> The following is the fstests config file that was used during testing.
> 
> export FSTYP=xfs
> 
> export TEST_DEV=/dev/loop0
> export TEST_DIR=/mnt/test
> export TEST_LOGDEV=/dev/loop2
> 
> export SCRATCH_DEV=/dev/loop1
> export SCRATCH_MNT=/mnt/scratch
> export SCRATCH_LOGDEV=/dev/loop3

Thanks for the report. So dm flakey sets up:

/dev/dm-0 over /dev/loop0
/dev/dm-1 over /dev/loop2

and then we mount an xfs filesystem with:

/dev/loop2 as logdev and /dev/loop0 as the main device.

So on current kernels what happens is that if you freeze the main
device you end up:

bdev_freeze(dm-0)
-> get_super(dm-0) # finds xfs sb
   -> freeze_super(sb)

if you also freeze the log device afterwards via:

bdev_freeze(dm-1)
-> get_super(dm-1) # doesn't find xfs sb because freezing only works for
                   # main device

What's currently in -next allows you to roughly do the following:

bdev_freeze(dm-0)
-> fs_bdev_freeze(dm-0->sb)
   -> freeze_super(dm-0->sb) # returns 0

bdev_freeze(dm-1)
-> fs_bdev_freeze(dm-1->sb)
   -> freeze_super(dm-1->sb) # returns -EBUSY

So you'll see EBUSY because the superblock was already frozen when the
main block device was frozen. I was somewhat expecting that we may run
into such issues.

I think we just need to figure out what we want to do in cases the
superblock is frozen via multiple devices. It would probably be correct
to keep it frozen as long as any of the devices is frozen?

  reply	other threads:[~2023-11-02 14:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 12:36 [BUG REPORT] next-20231102: generic/311 fails on XFS with external log Chandan Babu R
2023-11-02 14:54 ` Christian Brauner [this message]
2023-11-02 20:48   ` Dave Chinner
2023-11-03  8:14   ` Christoph Hellwig
2023-11-03  8:35     ` Christian Brauner
2023-11-03 13:52 ` [PATCH] fs: handle freezing from multiple devices Christian Brauner
2023-11-03 14:19   ` Christoph Hellwig
2023-11-03 15:10     ` Christian Brauner
2023-11-03 15:43       ` Jan Kara
2023-11-03 16:49         ` Christian Brauner
2023-11-06  7:21           ` Christoph Hellwig
2023-11-04 14:00 ` [PATCH v2 0/2] Handle multi device freezing Christian Brauner
2023-11-06  8:21   ` Chandan Babu R
2023-11-04 14:00 ` [PATCH v2 1/2] fs: remove dead check Christian Brauner
2023-11-06  7:29   ` Christoph Hellwig
2023-11-06 10:39   ` Jan Kara
2023-11-06 12:49   ` [PATCH v2 0/2] Handle multi device freezing Christian Brauner
2023-11-04 14:00 ` [PATCH v2 2/2] fs: handle freezing from multiple devices Christian Brauner
2023-11-06  7:30   ` Christoph Hellwig
2023-11-06 11:30   ` Jan Kara
2023-11-06 12:44     ` Christian Brauner

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=20231102-teich-absender-47a27e86e78f@brauner \
    --to=brauner@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=chandanbabu@kernel.org \
    --cc=dchinner@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).