/[linux-patches]/genpatches-2.6/trunk/2.6.12-pre/2905_procfs-hardlinks.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.12-pre/2905_procfs-hardlinks.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (show annotations) (download) (as text)
Sat Jun 11 23:20:41 2005 UTC (15 years, 5 months ago) by dsd
File MIME type: text/x-diff
File size: 1622 byte(s)
Create 2.6.12 branch
1 The pid directories in /proc/ currently return the wrong hardlink count - 3, when there are actually 4 : ".", "..", "fd", and "task".
2
3 This is easy to notice using find(1):
4 cd /proc/<pid>
5 find
6
7 In the output, you'll see a message similar to:
8 find: WARNING: Hard link count is wrong for .: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched.
9
10 http://bugs.gentoo.org/show_bug.cgi?id=86031
11
12 I also noticed that CONFIG_SECURITY can add a 5th: attr, and performed a similar fix on the task directories too.
13
14 Signed-off-by: Daniel Drake <dsd@gentoo.org>
15
16 --- linux-2.6.11-gentoo-r5/fs/proc/base.c.orig 2005-04-01 14:06:43.000000000 +0100
17 +++ linux-2.6.11-gentoo-r5/fs/proc/base.c 2005-04-01 14:35:39.000000000 +0100
18 @@ -1702,8 +1702,12 @@ struct dentry *proc_pid_lookup(struct in
19 inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO;
20 inode->i_op = &proc_tgid_base_inode_operations;
21 inode->i_fop = &proc_tgid_base_operations;
22 - inode->i_nlink = 3;
23 inode->i_flags|=S_IMMUTABLE;
24 +#ifdef CONFIG_SECURITY
25 + inode->i_nlink = 5;
26 +#else
27 + inode->i_nlink = 4;
28 +#endif
29
30 dentry->d_op = &pid_base_dentry_operations;
31
32 @@ -1757,8 +1761,12 @@ static struct dentry *proc_task_lookup(s
33 inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO;
34 inode->i_op = &proc_tid_base_inode_operations;
35 inode->i_fop = &proc_tid_base_operations;
36 - inode->i_nlink = 3;
37 inode->i_flags|=S_IMMUTABLE;
38 +#ifdef CONFIG_SECURITY
39 + inode->i_nlink = 4;
40 +#else
41 + inode->i_nlink = 3;
42 +#endif
43
44 dentry->d_op = &pid_base_dentry_operations;
45

  ViewVC Help
Powered by ViewVC 1.1.20