linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fat: port to vfs{g,u}id_t and associated helpers
@ 2022-09-09  9:30 Christian Brauner
  2022-09-09 10:01 ` OGAWA Hirofumi
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Brauner @ 2022-09-09  9:30 UTC (permalink / raw)
  To: OGAWA Hirofumi
  Cc: Christian Brauner, Seth Forshee, Christoph Hellwig, linux-fsdevel

A while ago we introduced a dedicated vfs{g,u}id_t type in commit
1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched
over a good part of the VFS. Ultimately we will remove all legacy
idmapped mount helpers that operate only on k{g,u}id_t in favor of the
new type safe helpers that operate on vfs{g,u}id_t.

Cc: Seth Forshee (Digital Ocean) <sforshee@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
---
 fs/fat/file.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/fat/file.c b/fs/fat/file.c
index 3e4eb3467cb4..8a6b493b5b5f 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -461,8 +461,9 @@ static int fat_allow_set_time(struct user_namespace *mnt_userns,
 {
 	umode_t allow_utime = sbi->options.allow_utime;
 
-	if (!uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) {
-		if (in_group_p(i_gid_into_mnt(mnt_userns, inode)))
+	if (!vfsuid_eq_kuid(i_uid_into_vfsuid(mnt_userns, inode),
+			    current_fsuid())) {
+		if (vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)))
 			allow_utime >>= 3;
 		if (allow_utime & MAY_WRITE)
 			return 1;

base-commit: 7e18e42e4b280c85b76967a9106a13ca61c16179
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] fat: port to vfs{g,u}id_t and associated helpers
  2022-09-09  9:30 [PATCH] fat: port to vfs{g,u}id_t and associated helpers Christian Brauner
@ 2022-09-09 10:01 ` OGAWA Hirofumi
  2022-09-09 10:26   ` Christian Brauner
  0 siblings, 1 reply; 7+ messages in thread
From: OGAWA Hirofumi @ 2022-09-09 10:01 UTC (permalink / raw)
  To: Christian Brauner; +Cc: Seth Forshee, Christoph Hellwig, linux-fsdevel

Christian Brauner <brauner@kernel.org> writes:

> A while ago we introduced a dedicated vfs{g,u}id_t type in commit
> 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched
> over a good part of the VFS. Ultimately we will remove all legacy
> idmapped mount helpers that operate only on k{g,u}id_t in favor of the
> new type safe helpers that operate on vfs{g,u}id_t.

If consistent with other parts in kernel, looks good.

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Thanks.

> Cc: Seth Forshee (Digital Ocean) <sforshee@kernel.org>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> Cc: linux-fsdevel@vger.kernel.org
> Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
> ---
>  fs/fat/file.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fat/file.c b/fs/fat/file.c
> index 3e4eb3467cb4..8a6b493b5b5f 100644
> --- a/fs/fat/file.c
> +++ b/fs/fat/file.c
> @@ -461,8 +461,9 @@ static int fat_allow_set_time(struct user_namespace *mnt_userns,
>  {
>  	umode_t allow_utime = sbi->options.allow_utime;
>  
> -	if (!uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) {
> -		if (in_group_p(i_gid_into_mnt(mnt_userns, inode)))
> +	if (!vfsuid_eq_kuid(i_uid_into_vfsuid(mnt_userns, inode),
> +			    current_fsuid())) {
> +		if (vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)))
>  			allow_utime >>= 3;
>  		if (allow_utime & MAY_WRITE)
>  			return 1;
>
> base-commit: 7e18e42e4b280c85b76967a9106a13ca61c16179

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] fat: port to vfs{g,u}id_t and associated helpers
  2022-09-09 10:01 ` OGAWA Hirofumi
@ 2022-09-09 10:26   ` Christian Brauner
  2022-09-09 12:33     ` OGAWA Hirofumi
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Brauner @ 2022-09-09 10:26 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: Seth Forshee, Christoph Hellwig, linux-fsdevel

On Fri, Sep 09, 2022 at 07:01:07PM +0900, OGAWA Hirofumi wrote:
> Christian Brauner <brauner@kernel.org> writes:
> 
> > A while ago we introduced a dedicated vfs{g,u}id_t type in commit
> > 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched
> > over a good part of the VFS. Ultimately we will remove all legacy
> > idmapped mount helpers that operate only on k{g,u}id_t in favor of the
> > new type safe helpers that operate on vfs{g,u}id_t.
> 
> If consistent with other parts in kernel, looks good.
> 
> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Just to make sure: will you be taking this patch yourself or should I?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] fat: port to vfs{g,u}id_t and associated helpers
  2022-09-09 10:26   ` Christian Brauner
@ 2022-09-09 12:33     ` OGAWA Hirofumi
  2022-09-19  8:07       ` Christian Brauner
  0 siblings, 1 reply; 7+ messages in thread
From: OGAWA Hirofumi @ 2022-09-09 12:33 UTC (permalink / raw)
  To: Christian Brauner; +Cc: Seth Forshee, Christoph Hellwig, linux-fsdevel

Christian Brauner <brauner@kernel.org> writes:

> On Fri, Sep 09, 2022 at 07:01:07PM +0900, OGAWA Hirofumi wrote:
>> Christian Brauner <brauner@kernel.org> writes:
>> 
>> > A while ago we introduced a dedicated vfs{g,u}id_t type in commit
>> > 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched
>> > over a good part of the VFS. Ultimately we will remove all legacy
>> > idmapped mount helpers that operate only on k{g,u}id_t in favor of the
>> > new type safe helpers that operate on vfs{g,u}id_t.
>> 
>> If consistent with other parts in kernel, looks good.
>> 
>> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>
> Just to make sure: will you be taking this patch yourself or should I?

Ah, I was expecting almost all convert patches goes at once via you or
vfs git.  However, if you want this goes via me, please let me know.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] fat: port to vfs{g,u}id_t and associated helpers
  2022-09-09 12:33     ` OGAWA Hirofumi
@ 2022-09-19  8:07       ` Christian Brauner
  2022-09-19 11:24         ` OGAWA Hirofumi
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Brauner @ 2022-09-19  8:07 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: Seth Forshee, Christoph Hellwig, linux-fsdevel

On Fri, Sep 09, 2022 at 09:33:12PM +0900, OGAWA Hirofumi wrote:
> Christian Brauner <brauner@kernel.org> writes:
> 
> > On Fri, Sep 09, 2022 at 07:01:07PM +0900, OGAWA Hirofumi wrote:
> >> Christian Brauner <brauner@kernel.org> writes:
> >> 
> >> > A while ago we introduced a dedicated vfs{g,u}id_t type in commit
> >> > 1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched
> >> > over a good part of the VFS. Ultimately we will remove all legacy
> >> > idmapped mount helpers that operate only on k{g,u}id_t in favor of the
> >> > new type safe helpers that operate on vfs{g,u}id_t.
> >> 
> >> If consistent with other parts in kernel, looks good.
> >> 
> >> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> >
> > Just to make sure: will you be taking this patch yourself or should I?
> 
> Ah, I was expecting almost all convert patches goes at once via you or
> vfs git.  However, if you want this goes via me, please let me know.

The patch is standalone which is why it would be great if you could just
take it. :)

Thanks!
Christian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] fat: port to vfs{g,u}id_t and associated helpers
  2022-09-19  8:07       ` Christian Brauner
@ 2022-09-19 11:24         ` OGAWA Hirofumi
  2022-09-19 14:53           ` Christian Brauner
  0 siblings, 1 reply; 7+ messages in thread
From: OGAWA Hirofumi @ 2022-09-19 11:24 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Christian Brauner, Seth Forshee, Christoph Hellwig, linux-fsdevel

Christian Brauner <brauner@kernel.org> writes:

> On Fri, Sep 09, 2022 at 09:33:12PM +0900, OGAWA Hirofumi wrote:
>> Christian Brauner <brauner@kernel.org> writes:
>> 
>> Ah, I was expecting almost all convert patches goes at once via you or
>> vfs git.  However, if you want this goes via me, please let me know.
>
> The patch is standalone which is why it would be great if you could just
> take it. :)

Ok, Please queuing this patch, akpm.
Thanks.


From: Christian Brauner <brauner@kernel.org>
Subject: [PATCH] fat: port to vfs{g,u}id_t and associated helpers

A while ago we introduced a dedicated vfs{g,u}id_t type in commit
1e5267cd0895 ("mnt_idmapping: add vfs{g,u}id_t"). We already switched
over a good part of the VFS. Ultimately we will remove all legacy
idmapped mount helpers that operate only on k{g,u}id_t in favor of the
new type safe helpers that operate on vfs{g,u}id_t.

Cc: Seth Forshee (Digital Ocean) <sforshee@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: linux-fsdevel@vger.kernel.org
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
---
 fs/fat/file.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/fat/file.c b/fs/fat/file.c
index 3e4eb3467cb4..8a6b493b5b5f 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -461,8 +461,9 @@ static int fat_allow_set_time(struct user_namespace *mnt_userns,
 {
 	umode_t allow_utime = sbi->options.allow_utime;
 
-	if (!uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) {
-		if (in_group_p(i_gid_into_mnt(mnt_userns, inode)))
+	if (!vfsuid_eq_kuid(i_uid_into_vfsuid(mnt_userns, inode),
+			    current_fsuid())) {
+		if (vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)))
 			allow_utime >>= 3;
 		if (allow_utime & MAY_WRITE)
 			return 1;

base-commit: 7e18e42e4b280c85b76967a9106a13ca61c16179
-- 

2.34.1
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] fat: port to vfs{g,u}id_t and associated helpers
  2022-09-19 11:24         ` OGAWA Hirofumi
@ 2022-09-19 14:53           ` Christian Brauner
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Brauner @ 2022-09-19 14:53 UTC (permalink / raw)
  To: OGAWA Hirofumi
  Cc: Andrew Morton, Seth Forshee, Christoph Hellwig, linux-fsdevel

On Mon, Sep 19, 2022 at 08:24:40PM +0900, OGAWA Hirofumi wrote:
> Christian Brauner <brauner@kernel.org> writes:
> 
> > On Fri, Sep 09, 2022 at 09:33:12PM +0900, OGAWA Hirofumi wrote:
> >> Christian Brauner <brauner@kernel.org> writes:
> >> 
> >> Ah, I was expecting almost all convert patches goes at once via you or
> >> vfs git.  However, if you want this goes via me, please let me know.
> >
> > The patch is standalone which is why it would be great if you could just
> > take it. :)
> 
> Ok, Please queuing this patch, akpm.

Oh, I thought you had your own tree that's why I asked.
Then nm, and I'll just pick it up.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-19 14:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  9:30 [PATCH] fat: port to vfs{g,u}id_t and associated helpers Christian Brauner
2022-09-09 10:01 ` OGAWA Hirofumi
2022-09-09 10:26   ` Christian Brauner
2022-09-09 12:33     ` OGAWA Hirofumi
2022-09-19  8:07       ` Christian Brauner
2022-09-19 11:24         ` OGAWA Hirofumi
2022-09-19 14:53           ` Christian Brauner

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).