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

Reply via email to