Skip to contentSkip to conversation

attr: handle idmapped mounts

bug report Dan Carpenter 2 participants 2 messages Jan 28, 2021 VFS

lore
Share & tools
lore
#0 lore raw

Hello Christian Brauner,

The patch 2f221d6f7b88: "attr: handle idmapped mounts" from Jan 21, 2021, leads to the following static checker warning:

	fs/attr.c:129 setattr_prepare()
	warn: inconsistent indenting

fs/attr.c
124 /* Make sure a caller can chmod. */
125 if (ia_valid & ATTR_MODE) {
126 if (!inode_owner_or_capable(mnt_userns, inode))
127 return -EPERM;
128 /* Also check the setgid bit! */
129 if (!in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid :

      ^^^^^^^^^^^^^^^^^

The patch accidentally swapped tabs for spaces.

The kbuild-bot is supposed to warn about these, but I searched on the lore.kernel.org thread and didn't see a warning.
https://lore.kernel.org/containers/20210121131959.646623-8-christian.brauner(a)ubuntu.com/
Presumably it is coming soon.

   130	                                i_gid_into_mnt(mnt_userns, inode)) &&
   131	                    !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
   132				attr->ia_mode &= ~S_ISGID;
   133		}

regards,
dan carpenter

#1 lore raw
Quoted 10 lines · Dan Carpenter

Hello Christian Brauner,

The patch 2f221d6f7b88: "attr: handle idmapped mounts" from Jan 21, 2021, leads to the following static checker warning:

	fs/attr.c:129 setattr_prepare()
	warn: inconsistent indenting

fs/attr.c
124 /* Make sure a caller can chmod. */

Quoted 7 lines
   125		if (ia_valid & ATTR_MODE) {
   126			if (!inode_owner_or_capable(mnt_userns, inode))
   127				return -EPERM;
   128			/* Also check the setgid bit! */
   129	               if (!in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid :
      ^^^^^^^^^^^^^^^^^

The patch accidentally swapped tabs for spaces.

Thanks. Must've sneaked in despite clang-format. Will likely fix in a separate commit. I don't want to rebase because of this.