mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/5] selinuxfs cleanups - fix hard link count
@ 2006-02-22 14:51 James Morris
  2006-02-22 14:52 ` [PATCH 2/5] selinuxfs cleanups - use sel_make_dir() James Morris
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Morris @ 2006-02-22 14:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Stephen Smalley, linux-kernel

This patch fixes the hard link count for selinuxfs directories, which are 
currently one short.

Please apply.


Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>

---

 security/selinux/selinuxfs.c |    4 ++++
 1 file changed, 4 insertions(+)


diff -purN -X dontdiff linux-2.6.16-rc4.o/security/selinux/selinuxfs.c linux-2.6.16-rc4.w/security/selinux/selinuxfs.c
--- linux-2.6.16-rc4.o/security/selinux/selinuxfs.c	2006-02-17 17:23:45.000000000 -0500
+++ linux-2.6.16-rc4.w/security/selinux/selinuxfs.c	2006-02-19 17:48:41.000000000 -0500
@@ -1198,6 +1198,8 @@ static int sel_make_dir(struct super_blo
 	}
 	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;
@@ -1239,6 +1241,8 @@ static int sel_fill_super(struct super_b
 		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();

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-02-22 14:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-22 14:51 [PATCH 1/5] selinuxfs cleanups - fix hard link count James Morris
2006-02-22 14:52 ` [PATCH 2/5] selinuxfs cleanups - use sel_make_dir() James Morris
2006-02-22 14:54 ` [PATCH 3/5] selinuxfs cleanups - sel_fill_super exit path James Morris
2006-02-22 14:55 ` [PATCH 4/5] selinuxfs cleanups - sel_make_bools James Morris
2006-02-22 14:56 ` [PATCH 5/5] selinuxfs cleanups - sel_make_avc_files James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®