Skip to content

Commit

Permalink
[PATCH] selinuxfs cleanups: fix hard link count
Browse files Browse the repository at this point in the history
Fix the hard link count for selinuxfs directories, which are currently one
short.

Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
James Morris authored and Linus Torvalds committed Mar 22, 2006
1 parent 68bdcf2 commit 40e906f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions security/selinux/selinuxfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,8 @@ static int sel_make_dir(struct super_block *sb, struct dentry *dentry)
}
inode->i_op = &simple_dir_inode_operations;
inode->i_fop = &simple_dir_operations;
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode->i_nlink++;
d_add(dentry, inode);
out:
return ret;
Expand Down Expand Up @@ -1222,6 +1224,8 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
goto out;
inode->i_op = &simple_dir_inode_operations;
inode->i_fop = &simple_dir_operations;
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode->i_nlink++;
d_add(dentry, inode);
bool_dir = dentry;
ret = sel_make_bools();
Expand Down

0 comments on commit 40e906f

Please sign in to comment.