linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Cc: mszeredi@redhat.com, stgraber@stgraber.org,
	 linux-fsdevel@vger.kernel.org,
	Seth Forshee <sforshee@kernel.org>,
	 Miklos Szeredi <miklos@szeredi.hu>,
	Amir Goldstein <amir73il@gmail.com>,
	 Bernd Schubert <bschubert@ddn.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 03/15] fs/fuse: add an idmap argument to fuse_simple_request
Date: Wed, 4 Sep 2024 17:25:40 +0200	[thread overview]
Message-ID: <20240904-baugrube-erhoben-b3c1c49a2645@brauner> (raw)
In-Reply-To: <20240903151626.264609-4-aleksandr.mikhalitsyn@canonical.com>

On Tue, Sep 03, 2024 at 05:16:14PM GMT, Alexander Mikhalitsyn wrote:
> If idmap == NULL *and* filesystem daemon declared idmapped mounts
> support, then uid/gid values in a fuse header will be -1.
> 
> No functional changes intended.
> 
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: Seth Forshee <sforshee@kernel.org>
> Cc: Miklos Szeredi <miklos@szeredi.hu>
> Cc: Amir Goldstein <amir73il@gmail.com>
> Cc: Bernd Schubert <bschubert@ddn.com>
> Cc: <linux-fsdevel@vger.kernel.org>
> Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
> ---

Huha, you end up extending fuse_simple_request() with an idmap argument
and passing NULL 38 times and non-NULL only 4 times at the end of this
patch series. That's not pretty. Also, I really dislike passing NULL as
an argument to the idmap helpers. All of the idmapping code uses
nop_mnt_idmap for this case and I think we should the same just with
invalid_mnt_idmap constant.

So I would propose two changes:

(1) Add an extern invalid_mnt_idmap into mnt_idmapping.h and
    define it in fs/mnt_idmapping.c so that will always yield
    INVALID_VFSUID/INVALID_VFSGID. Basically, it's the same definition
    as for nop_mnt_idmap.

(2) Instead of extending fuse_simple_request() with an additional
    argument rename fuse_simple_request() to __fuse_simple_request()
    and extend __fuse_simple_request() with a struct mnt_idmap argument.

    * make fuse_simple_request() a static inline helper that calls
      __fuse_simple_request() with invalid_mnt_idmap in the fuse_i.h
      header.

    * add fuse_idmap_request() that also calls __fuse_simple_request()
      but just passes through the idmap argument.

  reply	other threads:[~2024-09-04 15:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 15:16 [PATCH v4 00/15] fuse: basic support for idmapped mounts Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 01/15] fs/namespace: introduce SB_I_NOIDMAP flag Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 02/15] fs/fuse: add basic infrastructure to support idmappings Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 03/15] fs/fuse: add an idmap argument to fuse_simple_request Alexander Mikhalitsyn
2024-09-04 15:25   ` Christian Brauner [this message]
2024-09-03 15:16 ` [PATCH v4 04/15] fs/fuse: support idmapped FUSE_EXT_GROUPS Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 05/15] fs/fuse: support idmap for mkdir/mknod/symlink/create/tmpfile Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 06/15] fs/fuse: support idmapped getattr inode op Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 07/15] fs/fuse: support idmapped ->permission " Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 08/15] fs/fuse: support idmapped ->setattr op Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 09/15] fs/fuse: drop idmap argument from __fuse_get_acl Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 10/15] fs/fuse: support idmapped ->set_acl Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 11/15] fs/fuse: support idmapped ->rename op Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 12/15] fs/fuse: handle idmappings properly in ->write_iter Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 13/15] fs/fuse: warn if fuse_access is called when idmapped mounts are allowed Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 14/15] fs/fuse: allow idmapped mounts Alexander Mikhalitsyn
2024-09-03 15:16 ` [PATCH v4 15/15] fs/fuse/virtio_fs: " Alexander Mikhalitsyn
2024-09-05 19:45   ` Stefan Hajnoczi
2024-09-04 15:15 ` [PATCH v4 00/15] fuse: basic support for " Miklos Szeredi
2024-09-04 15:29   ` Christian Brauner
2024-09-04 16:59     ` Miklos Szeredi
2024-09-04 17:21       ` Aleksandr Mikhalitsyn

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=20240904-baugrube-erhoben-b3c1c49a2645@brauner \
    --to=brauner@kernel.org \
    --cc=aleksandr.mikhalitsyn@canonical.com \
    --cc=amir73il@gmail.com \
    --cc=bschubert@ddn.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mszeredi@redhat.com \
    --cc=sforshee@kernel.org \
    --cc=stgraber@stgraber.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).