public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org,
	linux-ext4@vger.kernel.org
Subject: Re: [PATCH 1/6] fs: super_block->s_uuid_len
Date: Tue, 6 Feb 2024 08:58:49 +1100	[thread overview]
Message-ID: <ZcFaGRV08WQOxCzb@dread.disaster.area> (raw)
In-Reply-To: <20240205200529.546646-2-kent.overstreet@linux.dev>

On Mon, Feb 05, 2024 at 03:05:12PM -0500, Kent Overstreet wrote:
> Some weird old filesytems have UUID-like things that we wish to expose
> as UUIDs, but are smaller; add a length field so that the new
> FS_IOC_(GET|SET)UUID ioctls can handle them in generic code.
> 
> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
> ---
>  fs/super.c         | 1 +
>  include/linux/fs.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/fs/super.c b/fs/super.c
> index d35e85295489..ed688d2a58a7 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -375,6 +375,7 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags,
>  	s->s_time_gran = 1000000000;
>  	s->s_time_min = TIME64_MIN;
>  	s->s_time_max = TIME64_MAX;
> +	s->s_uuid_len = sizeof(s->s_uuid);

So if the filesystem doesn't copy a uuid into sb->s_uuid, then we
allow those 16 bytes to be pulled from userspace?

Shouldn't this only get set when the filesystem copies it's uuid
to the superblock?

And then in the get uuid  ioctl, if s_uuid_len is zero we can return
-ENOENT to indicate the filesystem doesn't have a UUID, rather that
require userspace to determine a filesystem doesn't have a valid
UUID somehow...

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2024-02-05 21:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 20:05 [PATCH 0/6] filesystem visibility ioctls Kent Overstreet
2024-02-05 20:05 ` [PATCH 1/6] fs: super_block->s_uuid_len Kent Overstreet
2024-02-05 21:58   ` Dave Chinner [this message]
2024-02-05 22:56     ` Kent Overstreet
2024-02-05 20:05 ` [PATCH 2/6] fs: FS_IOC_GETUUID Kent Overstreet
2024-02-05 22:17   ` Dave Chinner
2024-02-05 22:49     ` Kent Overstreet
2024-02-05 23:59       ` Darrick J. Wong
2024-02-06  8:24       ` Amir Goldstein
2024-02-06  9:00         ` Kent Overstreet
2024-02-05 20:05 ` [PATCH 3/6] fat: Hook up sb->s_uuid Kent Overstreet
2024-02-05 20:05 ` [PATCH 4/6] fs: FS_IOC_GETSYSFSNAME Kent Overstreet
2024-02-05 22:27   ` Darrick J. Wong
2024-02-05 22:43     ` Kent Overstreet
2024-02-06  1:39       ` David Sterba
2024-02-06  4:20         ` Randy Dunlap
2024-02-06  4:33           ` Kent Overstreet
2024-02-06  5:08             ` Darrick J. Wong
2024-02-06  5:13               ` Kent Overstreet
2024-02-05 20:05 ` [PATCH 5/6] xfs: add support for FS_IOC_GETSYSFSNAME Kent Overstreet
2024-02-05 20:05 ` [PATCH 6/6] bcachefs: " Kent Overstreet
2024-02-06 16:22 ` [PATCH 0/6] filesystem visibility ioctls 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=ZcFaGRV08WQOxCzb@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@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