Commit 40e906f8 authored by James Morris's avatar James Morris Committed by Linus Torvalds

[PATCH] selinuxfs cleanups: fix hard link count

Fix the hard link count for selinuxfs directories, which are currently one
short.
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
Acked-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 68bdcf28
...@@ -1181,6 +1181,8 @@ static int sel_make_dir(struct super_block *sb, struct dentry *dentry) ...@@ -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_op = &simple_dir_inode_operations;
inode->i_fop = &simple_dir_operations; inode->i_fop = &simple_dir_operations;
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode->i_nlink++;
d_add(dentry, inode); d_add(dentry, inode);
out: out:
return ret; return ret;
...@@ -1222,6 +1224,8 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent) ...@@ -1222,6 +1224,8 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
goto out; goto out;
inode->i_op = &simple_dir_inode_operations; inode->i_op = &simple_dir_inode_operations;
inode->i_fop = &simple_dir_operations; inode->i_fop = &simple_dir_operations;
/* directory inodes start off with i_nlink == 2 (for "." entry) */
inode->i_nlink++;
d_add(dentry, inode); d_add(dentry, inode);
bool_dir = dentry; bool_dir = dentry;
ret = sel_make_bools(); ret = sel_make_bools();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment