Re: md:When opened /proc/mdstat, increase the refcount of

From
NeilBrown <hidden>
Date
2012-02-26 08:36:06
Reply to
majianpeng, 2012-02-26
On Sun, 26 Feb 2012 13:39:57 +0800 "majianpeng" [off-list ref] wrote:
Yes,I know this.But I can't to fix procfs,so using this patch.
I wonder if this will fix it.

diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 7737c54..fc89842 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -449,7 +449,8 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
 		if (de->proc_iops)
 			inode->i_op = de->proc_iops;
 		if (de->proc_fops) {
-			if (S_ISREG(inode->i_mode)) {
+			if (S_ISREG(inode->i_mode) &&
+			    !de->proc_fops->owner) {
 #ifdef CONFIG_COMPAT
 				if (!de->proc_fops->compat_ioctl)
 					inode->i_fop =

however I don't really understand the point of proc_ref_file_ops, so maybe
I'm missing something.

NeilBrown

Attachments

Thread (7 messages) 7 messages, 2 authors, last reply 2012-02-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help