Discrepancy in ext2_new_inode from 2.2.5

Martin Pool (mbp@wistful.humbug.org.au)
Sat, 10 Apr 1999 17:13:37 +1000


ext2_new_inode from 2.2.5 contains this code to handle SysV/BSD group
semantics: (ialloc.c:468)

if (test_opt (sb, GRPID))
inode->i_gid = dir->i_gid;
else if (dir->i_mode & S_ISGID) {
inode->i_gid = dir->i_gid;
if (S_ISDIR(mode))
mode |= S_ISGID;
} else
inode->i_gid = current->fsgid;

However, the new value assigned to mode in the middle case is never
used in the rest of the function. The grpid function is separately
implemented in ext2_mkdir (namei.c:520):

if (dir->i_mode & S_ISGID)
inode->i_mode |= S_ISGID;

with slightly different behaviour: the SGID bit is inherited even if
the fs is mounted -o nogrpid. It's harmless, but I noticed it and
thought perhaps somebody would like to delete the redundant code from
ialloc.c -- or tell me what I've missed.

--
Martin Pool

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/