Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22514
b: refs/heads/master
c: edb20fb
h: refs/heads/master
v: v3
  • Loading branch information
James Morris authored and Linus Torvalds committed Mar 22, 2006
1 parent 1730135 commit 1cfe74d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d6aafa65354cd2dbb089ab9e7dc618f22230fe32
refs/heads/master: edb20fb5be2ff6943920aca4ccab0f4fdacddb9c
14 changes: 9 additions & 5 deletions trunk/security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,12 +1166,12 @@ static int sel_make_avc_files(struct dentry *dir)
return ret;
}

static int sel_make_dir(struct super_block *sb, struct dentry *dentry)
static int sel_make_dir(struct inode *dir, struct dentry *dentry)
{
int ret = 0;
struct inode *inode;

inode = sel_make_inode(sb, S_IFDIR | S_IRUGO | S_IXUGO);
inode = sel_make_inode(dir->i_sb, S_IFDIR | S_IRUGO | S_IXUGO);
if (!inode) {
ret = -ENOMEM;
goto out;
Expand All @@ -1181,6 +1181,8 @@ static int sel_make_dir(struct super_block *sb, struct dentry *dentry)
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode->i_nlink++;
d_add(dentry, inode);
/* bump link count on parent directory, too */
dir->i_nlink++;
out:
return ret;
}
Expand All @@ -1189,7 +1191,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
{
int ret;
struct dentry *dentry;
struct inode *inode;
struct inode *inode, *root_inode;
struct inode_security_struct *isec;

static struct tree_descr selinux_files[] = {
Expand All @@ -1212,13 +1214,15 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
if (ret)
goto err;

root_inode = sb->s_root->d_inode;

dentry = d_alloc_name(sb->s_root, BOOL_DIR_NAME);
if (!dentry) {
ret = -ENOMEM;
goto err;
}

ret = sel_make_dir(sb, dentry);
ret = sel_make_dir(root_inode, dentry);
if (ret)
goto err;

Expand Down Expand Up @@ -1250,7 +1254,7 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
goto err;
}

ret = sel_make_dir(sb, dentry);
ret = sel_make_dir(root_inode, dentry);
if (ret)
goto err;

Expand Down

0 comments on commit 1cfe74d

Please sign in to comment.