linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christian Brauner <brauner@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: manual merge of the vfs-brauner tree with the djw-vfs tree
Date: Tue, 22 Aug 2023 14:14:56 -0700	[thread overview]
Message-ID: <20230822211456.GC11286@frogsfrogsfrogs> (raw)
In-Reply-To: <20230822-mitbringen-unwillig-176fd9e8873b@brauner>

On Tue, Aug 22, 2023 at 10:19:00PM +0200, Christian Brauner wrote:
> > > my preferred solution. How do you feel about that?
> > 
> > I'm happy to have you pull my xfs-linux tags into your vfs tree. :)
> 
> Ah, sweet. I apppreciate that. I'll mention in the pr to Linus that if
> he wants to reject other parts of the super work that he should then
> still simply pull the freeze stuff from you without the rest.
> 
> > 
> > Here's a tag with just the two vfs patches:
> > https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git/tag/?h=vfs-6.6-merge-2
> > 
> > This second tag builds on that, by adding the first actual user of
> > FREEZE_HOLDER_KERNEL:
> > https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git/tag/?h=vfs-6.6-merge-3
> 
> Assuming I understood correctly I did just pull both tags and pushed
> them out. Would you please take a look at
> https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/log/?h=vfs.super
> and let me know if everything looks as expected? I'll be going afk in a
> bit just waiting for the kernel build to finish to kick of some
> xfstests. If you find anything I'll fix up any issues up tomorrow
> morning.

Hmm.  Looking at the {up,down}_write -> super_{un,}lock_excl conversion,
I think you missed wait_for_partially_frozen:

static int wait_for_partially_frozen(struct super_block *sb)
{
	int ret = 0;

	do {
		unsigned short old = sb->s_writers.frozen;

		up_write(&sb->s_umount);
		ret = wait_var_event_killable(&sb->s_writers.frozen,
					       sb->s_writers.frozen != old);
		down_write(&sb->s_umount);
	} while (ret == 0 &&
		 sb->s_writers.frozen != SB_UNFROZEN &&
		 sb->s_writers.frozen != SB_FREEZE_COMPLETE);

	return ret;
}

That said, freeze_super() took an s_active refcount at the top, called
super_lock_excl (which means the sb isn't DYING and has been BORN) and
doesn't release it before calling wait_for_partially_frozen.

AFAICT, the subsequent down_write -> super_lock_excl conversions in
freeze_super do not gain us much since I don't think the sb can get to
SB_DYING state without s_active reaching zero, right?  According to
"super: use higher-level helper for {freeze,thaw}", it sounds like the
subsequent down_write calls in freeze_super were replaced for
consistency, even though it "...isn't possible to observe a dying
superblock".

The missing conversion isn't strictly necessary, but it probably makese
sense to do it anyway.

(Aside from that, the conversion looks correct to me.)

> > 
> > There will be more for 6.7(+?) if Luis manages to get back to his
> > auto-fsfreeze during suspend, or if Shiyang finishes the series to
> > handle pmem media error reporting in xfs.
> 
> Ok, sounds good let me know/Cc me when ready/needed.

Will do!

--D

> 
> Thanks for all the help!

  reply	other threads:[~2023-08-22 21:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  1:05 linux-next: manual merge of the vfs-brauner tree with the djw-vfs tree Stephen Rothwell
2023-08-22  2:51 ` Darrick J. Wong
2023-08-22  9:46   ` Christian Brauner
2023-08-22 18:26     ` Darrick J. Wong
2023-08-22 20:19       ` Christian Brauner
2023-08-22 21:14         ` Darrick J. Wong [this message]
2023-08-23  7: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=20230822211456.GC11286@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=brauner@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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).