All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-fsdevel@vger.kernel.org,
	Seth Forshee <sforshee@digitalocean.com>,
	Aleksa Sarai <cyphar@cyphar.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 6/8] quota: port quota helpers mount ids
Date: Tue, 21 Jun 2022 12:40:10 +0200	[thread overview]
Message-ID: <20220621104010.so4nlmmg2rvsz3ov@wittgenstein> (raw)
In-Reply-To: <20220621102027.iw6yoo5lrr4oe3m6@quack3.lan>

On Tue, Jun 21, 2022 at 12:20:27PM +0200, Jan Kara wrote:
> On Mon 20-06-22 15:49:45, Christian Brauner wrote:
> > Port the is_quota_modification() and dqout_transfer() helper to type
> > safe kmnt{g,u}id_t. Since these helpers are only called by a few
> > filesystems don't introduce a new helper but simply extend the existing
> > helpers to pass down the mount's idmapping.
> > 
> > Note, that this is a non-functional change, i.e. nothing will have
> > happened here or at the end of this series to how quota are done! This
> > a change necessary because we will at the end of this series make
> > ownership changes easier to reason about by keeping the original value
> > in struct iattr for both non-idmapped and idmapped mounts.
> > 
> > For now we always pass the initial idmapping which makes the idmapping
> > functions these helpers call nops.
> > 
> > This is done because we currently always pass the actual value to be
> > written to i_{g,u}id via struct iattr. While this allowed us to treat
> > the {g,u}id values in struct iattr as values that can be directly
> > written to inode->i_{g,u}id it also increases the potential for
> > confusion for filesystems.
> > 
> > Now that we are about to introduce dedicated types to prevent this
> > confusion we will ultimately only map the value from the idmapped mount
> > into a filesystem value that can be written to inode->i_{g,u}id when the
> > filesystem actually updates the inode. So pass down the initial
> > idmapping until we finished that conversion.
> > 
> > Since struct iattr uses an anonymous union with overlapping types as
> > supported by the C filesystems that haven't converted to ia_mnt{g,u}id
> > won't see any difference and things will continue to work as before.
> > In other words, no functional changes intended with this change.
> > 
> > Cc: Seth Forshee <sforshee@digitalocean.com>
> > Cc: Christoph Hellwig <hch@lst.de>
> > Cc: Jan Kara <jack@suse.cz>
> > Cc: Aleksa Sarai <cyphar@cyphar.com>
> > Cc: Linus Torvalds <torvalds@linux-foundation.org>
> > Cc: Al Viro <viro@zeniv.linux.org.uk>
> > CC: linux-fsdevel@vger.kernel.org
> > Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
> 
> Yeah, this looks fairly innocent. Feel free to add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>
> 
> Just when do you plan to make changes actually using the passed namespace?

Hey Jan,

Thank you for the review!
The changes are in the last patch of the series. But it is all unrelated
to quotas and doesn't alter them in any way. We really just change how
ia_{vfs}uid is set up to get type safety which requires the generic
codepaths like here to calculate the correct value when they actually
perform a write instead of having performed that calculation when we
set up iattr. That's really all.

Thanks!
Christian

  reply	other threads:[~2022-06-21 10:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 13:49 [PATCH 0/8] introduce dedicated type for idmapped mounts Christian Brauner
2022-06-20 13:49 ` [PATCH 1/8] mnt_idmapping: add kmnt{g,u}id_t Christian Brauner
2022-06-20 14:28   ` Linus Torvalds
2022-06-20 15:25     ` Christian Brauner
2022-06-20 18:52       ` Linus Torvalds
2022-06-20 13:49 ` [PATCH 2/8] fs: add two type safe mapping helpers Christian Brauner
2022-06-20 13:49 ` [PATCH 3/8] fs: use mount types in iattr Christian Brauner
2022-06-20 13:49 ` [PATCH 4/8] fs: introduce tiny iattr ownership update helpers Christian Brauner
2022-06-20 13:49 ` [PATCH 5/8] fs: port to " Christian Brauner
2022-06-20 13:49 ` [PATCH 6/8] quota: port quota helpers mount ids Christian Brauner
2022-06-21 10:20   ` Jan Kara
2022-06-21 10:40     ` Christian Brauner [this message]
2022-06-20 13:49 ` [PATCH 7/8] security: pass down mount idmapping to setattr hook Christian Brauner
2022-06-20 13:49 ` [PATCH 8/8] attr: port attribute changes to new types 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=20220621104010.so4nlmmg2rvsz3ov@wittgenstein \
    --to=brauner@kernel.org \
    --cc=cyphar@cyphar.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sforshee@digitalocean.com \
    --cc=torvalds@linux-foundation.org \
    --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.