zero i_uid/i_gid on inode allocation
... and don't bother in callers. Don't bother with zeroing i_blocks, while we are at it - it's already been zeroed. i_mode is not worth the effort; it has no common default value. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1426,8 +1426,6 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st
|
||||
if (!ei->pid)
|
||||
goto out_unlock;
|
||||
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
if (task_dumpable(task)) {
|
||||
rcu_read_lock();
|
||||
cred = __task_cred(task);
|
||||
@@ -2349,8 +2347,6 @@ static struct dentry *proc_base_instantiate(struct inode *dir,
|
||||
if (!ei->pid)
|
||||
goto out_iput;
|
||||
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
inode->i_mode = p->mode;
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
inode->i_nlink = 2;
|
||||
|
Reference in New Issue
Block a user