spufs: fix bogosity in S_ISGID handling
clearing everything *except* S_ISGID (including the S_IFDIR, among other things) is wrong. Just use init_inode_owner() and be done with that... Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
b577d0cd21
commit
c4ab036a2f
|
@ -236,10 +236,7 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags,
|
||||||
if (!inode)
|
if (!inode)
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
|
|
||||||
if (dir->i_mode & S_ISGID) {
|
inode_init_owner(&init_user_ns, inode, dir, mode | S_IFDIR);
|
||||||
inode->i_gid = dir->i_gid;
|
|
||||||
inode->i_mode &= S_ISGID;
|
|
||||||
}
|
|
||||||
ctx = alloc_spu_context(SPUFS_I(dir)->i_gang); /* XXX gang */
|
ctx = alloc_spu_context(SPUFS_I(dir)->i_gang); /* XXX gang */
|
||||||
SPUFS_I(inode)->i_ctx = ctx;
|
SPUFS_I(inode)->i_ctx = ctx;
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
|
@ -470,10 +467,7 @@ spufs_mkgang(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
if (dir->i_mode & S_ISGID) {
|
inode_init_owner(&init_user_ns, inode, dir, mode | S_IFDIR);
|
||||||
inode->i_gid = dir->i_gid;
|
|
||||||
inode->i_mode &= S_ISGID;
|
|
||||||
}
|
|
||||||
gang = alloc_spu_gang();
|
gang = alloc_spu_gang();
|
||||||
SPUFS_I(inode)->i_ctx = NULL;
|
SPUFS_I(inode)->i_ctx = NULL;
|
||||||
SPUFS_I(inode)->i_gang = gang;
|
SPUFS_I(inode)->i_gang = gang;
|
||||||
|
|
Loading…
Reference in New Issue