diff mbox series

idmapped-mounts: account for EOVERFLOW

Message ID 20220920083522.1291798-1-brauner@kernel.org (mailing list archive)
State New, archived
Headers show
Series idmapped-mounts: account for EOVERFLOW | expand

Commit Message

Christian Brauner Sept. 20, 2022, 8:35 a.m. UTC
We introduced a new type vfs{g,u}id_t into the vfs in b27c82e12965
("attr: port attribute changes to new types"). This type makes sure that
{g,u}ids mapped into an idmapped mount are distinct from regular
k{g,u}id_t. This expands the possible errnos that users may see so we
need to handle both EINVAL and EOVERFLOW.

Cc: Seth Forshee (DigitalOcean) <sforshee@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
---
 src/vfs/idmapped-mounts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


base-commit: 890c50823b6430bf0929d9a57e76b9b4d6bbc25f

Comments

Zorro Lang Sept. 20, 2022, 2:42 p.m. UTC | #1
On Tue, Sep 20, 2022 at 10:35:22AM +0200, Christian Brauner wrote:
> We introduced a new type vfs{g,u}id_t into the vfs in b27c82e12965
> ("attr: port attribute changes to new types"). This type makes sure that
> {g,u}ids mapped into an idmapped mount are distinct from regular
> k{g,u}id_t. This expands the possible errnos that users may see so we
> need to handle both EINVAL and EOVERFLOW.
> 
> Cc: Seth Forshee (DigitalOcean) <sforshee@kernel.org>
> Cc: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
> ---

Make sense to me,

Reviewed-by: Zorro Lang <zlang@redhat.com>

>  src/vfs/idmapped-mounts.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/vfs/idmapped-mounts.c b/src/vfs/idmapped-mounts.c
> index c010dfa1..ed7948b6 100644
> --- a/src/vfs/idmapped-mounts.c
> +++ b/src/vfs/idmapped-mounts.c
> @@ -7367,7 +7367,7 @@ static int setattr_fix_968219708108(const struct vfstest_info *info)
>  		 */
>  		if (!fchownat(open_tree_fd, FILE1, 0, 0, AT_SYMLINK_NOFOLLOW))
>  			die("failure: change ownership");
> -		if (errno != EINVAL)
> +		if (errno != EINVAL && errno != EOVERFLOW)
>  			die("failure: errno");
>  
>  		/*
> @@ -7457,7 +7457,7 @@ static int setattr_fix_968219708108(const struct vfstest_info *info)
>  		 */
>  		if (!fchownat(open_tree_fd, FILE1, 0, 0, AT_SYMLINK_NOFOLLOW))
>  			die("failure: change ownership");
> -		if (errno != EINVAL)
> +		if (errno != EINVAL && errno != EOVERFLOW)
>  			die("failure: errno");
>  
>  		/*
> 
> base-commit: 890c50823b6430bf0929d9a57e76b9b4d6bbc25f
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/src/vfs/idmapped-mounts.c b/src/vfs/idmapped-mounts.c
index c010dfa1..ed7948b6 100644
--- a/src/vfs/idmapped-mounts.c
+++ b/src/vfs/idmapped-mounts.c
@@ -7367,7 +7367,7 @@  static int setattr_fix_968219708108(const struct vfstest_info *info)
 		 */
 		if (!fchownat(open_tree_fd, FILE1, 0, 0, AT_SYMLINK_NOFOLLOW))
 			die("failure: change ownership");
-		if (errno != EINVAL)
+		if (errno != EINVAL && errno != EOVERFLOW)
 			die("failure: errno");
 
 		/*
@@ -7457,7 +7457,7 @@  static int setattr_fix_968219708108(const struct vfstest_info *info)
 		 */
 		if (!fchownat(open_tree_fd, FILE1, 0, 0, AT_SYMLINK_NOFOLLOW))
 			die("failure: change ownership");
-		if (errno != EINVAL)
+		if (errno != EINVAL && errno != EOVERFLOW)
 			die("failure: errno");
 
 		/*