From: Al Viro <viro@zeniv.linux.org.uk>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] dcache: rename d_genocide()
Date: Mon, 12 Feb 2024 08:09:26 +0000 [thread overview]
Message-ID: <20240212080926.GJ608142@ZenIV> (raw)
In-Reply-To: <CAOQ4uxhizxoZWKrcRkpC641evkFBx-oZynm1r1htWBE7hNXc-g@mail.gmail.com>
On Mon, Feb 12, 2024 at 09:02:58AM +0200, Amir Goldstein wrote:
> If you are going to make kill_litter_super() an alias of kill_anon_super()
> I suggest going the extra mile and replacing the remaining 30 instances of
> kill_litter_super().
>
> If the rules become straight forward for the default ->kill_sb(),
> then maybe we should even make ->kill_sb() optional and do:
>
> diff --git a/fs/super.c b/fs/super.c
> index d35e85295489..6200cac0e4f8 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -458,6 +458,18 @@ static void kill_super_notify(struct super_block *sb)
> super_wake(sb, SB_DEAD);
> }
>
> +static void kill_sb(struct super_block *s)
> +{
> + struct file_system_type *fs = s->s_type;
> +
> + if (fs->kill_sb)
> + fs->kill_sb(s);
> + else if (fs->fs_flags & FS_REQUIRES_DEV)
> + kill_block_super(s);
> + else
> + kill_anon_super(s);
> +}
Bloody bad idea, IMO. Note that straight use of kill_anon_super()
pretty much forces you into doing everything from ->put_super().
And that leads to rather clumsy failure exits in foo_fill_super(),
since you *won't* get ->put_super() called unless you've got to
setting ->s_root.
Considering how easily the failure exits rot, I'd rather discourage
that variant.
next prev parent reply other threads:[~2024-02-12 8:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-10 10:06 [PATCH] dcache: rename d_genocide() Amir Goldstein
2024-02-10 23:27 ` Al Viro
2024-02-11 8:00 ` Amir Goldstein
2024-02-11 18:44 ` Al Viro
2024-02-12 7:02 ` Amir Goldstein
2024-02-12 8:09 ` Al Viro [this message]
2024-02-13 4:42 ` Al Viro
2024-02-13 6:42 ` Amir Goldstein
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=20240212080926.GJ608142@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
/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).