diff options
author | James Morris <jmorris@namei.org> | 2006-03-22 00:09:16 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 07:54:07 -0800 |
commit | 40e906f8224966ef65756cc75f9999ea2de0523d (patch) | |
tree | 6e72a24a93d1f36ae5d89e81d2020cd3d8a0bd9b /security | |
parent | 68bdcf28a8d245208a02dc9caa60fe13cc1b0ea8 (diff) | |
download | blackbird-op-linux-40e906f8224966ef65756cc75f9999ea2de0523d.tar.gz blackbird-op-linux-40e906f8224966ef65756cc75f9999ea2de0523d.zip |
[PATCH] selinuxfs cleanups: fix hard link count
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>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/selinuxfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index cc782083d71f..4f7cda67ac0a 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -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; @@ -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(); |