All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner	 <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Ian Kent <raven@themaw.net>, Josef Bacik <josef@toxicpanda.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] fs: add the ability for statmount() to report the fs_subtype
Date: Mon, 11 Nov 2024 06:28:56 -0500	[thread overview]
Message-ID: <de09d7f38923ed3db6050153f9c5279ebae8a4e6.camel@kernel.org> (raw)
In-Reply-To: <CAJfpegsdyZzqj52RS=T-tCyfKM9za2ViFkni5cwy1cVhNBO7JA@mail.gmail.com>

On Mon, 2024-11-11 at 11:49 +0100, Miklos Szeredi wrote:
> On Thu, 7 Nov 2024 at 22:00, Jeff Layton <jlayton@kernel.org> wrote:
> 
> > +       /*
> > +        * If nothing was emitted, return to avoid setting the flag
> > +        * and terminating the buffer.
> > +        */
> > +       if (seq->count == start)
> > +               return ret;
> 
> First of all, I don't think it's okay to subtly change behavior of
> other string attributes in this patch.   If that is what we want, it
> should be separated into a separate prep or followup patch.
> 

As far as I can tell, the existing cases in statmount_string() either
always emit a string or an error code. If a string isn't emitted, then
the two EOVERFLOW cases and the EAGAIN case can't happen, so I don't
think this will result in any change in behavior for the existing code.


> Clearing the returned mask if there's no subtype does sound like the
> right thing to do.  But it makes it impossible to detect whether the
> running kernel supports returning subtype or not.  Missing the
> STATMOUNT_FS_SUBTYPE in statmount.mask may mean two different things:
> 
>  - kernel supports returning subtype and filesystem does not have a subtype
> 
>  - kernel does not support returning a subtype and the filesystem may
> or may not have a subtype
> 
> I think we can live with  that, but it would be really good if there
> was a universal way to detect whether a particular feature is
> supported on the running kernel or not, and not have to rely on
> syscall specific ways.

The idea for statmount() was to add a statx() like interface. This is
exactly how statx() works, so I don't think it ought to be any sort of
surprise to anyone.

That said, if we did want to add a way to detect what flags are
actually supported, we could just add a new STATMOUNT_SUPPORTED_FLAGS
flag and add a field that holds a returned mask with all of the bits
set that the kernel supports.
-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2024-11-11 11:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 21:00 [PATCH v3 0/2] fs: allow statmount to fetch the subtype and devname Jeff Layton
2024-11-07 21:00 ` [PATCH v3 1/2] fs: add the ability for statmount() to report the fs_subtype Jeff Layton
2024-11-11 10:49   ` Miklos Szeredi
2024-11-11 11:28     ` Jeff Layton [this message]
2024-11-11 13:01       ` Miklos Szeredi
2024-11-11 13:28         ` Jeff Layton
2024-11-11 13:30           ` Christian Brauner
2024-11-07 21:00 ` [PATCH v3 2/2] fs: add the ability for statmount() to report the mnt_devname Jeff Layton
2024-11-08 12:19   ` Jan Kara
2024-11-11 14:31   ` Miklos Szeredi
2024-11-11  9:17 ` [PATCH v3 0/2] fs: allow statmount to fetch the subtype and devname Christian Brauner
2024-11-11 13:42   ` Jeff Layton
2024-11-12  9:37     ` Karel Zak
2024-11-12  9:42     ` Christian Brauner
2024-11-12 10:24       ` Miklos Szeredi
2024-11-12 13:12         ` Christian Brauner
2024-11-12 11:33       ` Jeff Layton

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=de09d7f38923ed3db6050153f9c5279ebae8a4e6.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=raven@themaw.net \
    --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 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.