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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Sun, 26 Feb 2012 13:39:57 +0800 "majianpeng" <majianpeng@xxxxxxxxx> 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) {
 				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.


Attachment: signature.asc
Description: PGP signature

[ATA RAID]     [Linux SCSI Target Infrastructure]     [Managing RAID on Linux]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device-Mapper]     [Kernel]     [Linux Books]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Photos]     [Yosemite Photos]     [Yosemite News]     [AMD 64]     [Linux Networking]

Add to Google Powered by Linux