From: Al Viro <viro@zeniv.linux.org.uk>
To: Xiaole He <hexiaole1994@126.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>,
"brauner@kernel.org" <brauner@kernel.org>,
"jack@suse.cz" <jack@suse.cz>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] fs/super.c: Add NULL check for type in iterate_supers_type
Date: Thu, 3 Apr 2025 04:50:40 +0100 [thread overview]
Message-ID: <20250403035040.GM2023217@ZenIV> (raw)
In-Reply-To: <75a45193.18746.195f9a088c4.Coremail.hexiaole1994@126.com>
On Thu, Apr 03, 2025 at 11:10:02AM +0800, Xiaole He wrote:
> Thank you for your thoughtfully feedback.
> I think you are right, and I'm sorry for my pedantic anxiety.
> So if we just ignore this patch for now, or I should submit a bug
> report to kernel community in order to invite more thorough fix?
> Thanks for your patient again.
I don't believe that adding random checks would make any sense -
same as for any library function, really.
Having the documentation slightly more clear would make sense,
though; currently it's
* iterate_supers_type - call function for superblocks of given type
* @type: fs type
* @f: function to call
* @arg: argument to pass to it
*
* Scans the superblock list and calls given function, passing it
* locked superblock and given argument.
and description could've been better. The weakest part in there is,
IMO, "the superblock list" - there is a global list of all superblocks
(inventively called 'super_blocks'), but that's not what gets scanned;
the list of superblocks of given type (type->fs_supers) we iterate
through.
Something along the lines of "Call given callback @f for all superblocks
of given type. The first argument passed to @f points to a locked superblock
that belongs to @type; the second is a caller-supplied opaque pointer @arg.
The caller is responsible for passing @arg that would make a valid second
argument for @f - compiler can't help here" might be a starting point,
but I'm not up to turning that into proper English.
next prev parent reply other threads:[~2025-04-03 3:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 3:45 [PATCH v1] fs/super.c: Add NULL check for type in iterate_supers_type Xiaole He
2025-04-02 11:38 ` James Bottomley
[not found] ` <4ee2fdcb.1854a.195f9828c86.Coremail.hexiaole1994@126.com>
2025-04-03 2:47 ` Al Viro
[not found] ` <75a45193.18746.195f9a088c4.Coremail.hexiaole1994@126.com>
2025-04-03 3:50 ` Al Viro [this message]
2025-04-03 8:01 ` 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=20250403035040.GM2023217@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=James.Bottomley@hansenpartnership.com \
--cc=brauner@kernel.org \
--cc=hexiaole1994@126.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.