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

- From: NeilBrown \<hidden\>
- Date: 2012-02-26 08:36:06 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2012/02/6619088
- Thread: https://ratatoskr.run/linux-raid/2012/02/6619084/t.md

```text
On Sun, 26 Feb 2012 13:39:57 +0800 "majianpeng" [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

- [signature.asc](https://ratatoskr.run/linux-raid/2012/02/6619088/attachment/0) (application/pgp-signature, 828 bytes)
