Procfs open hook bug.

From: Peter Enderborg (
Date: Tue Jul 01 2003 - 05:55:04 EST

I have done this little patch for the procfs_example.c

diff procfs_example.c
< static int open_qp(struct inode * inode, struct file * file)
< {
< printk("Open my node %p %p \n",inode,file);
< return -EINVAL;
< }
< foo_file->proc_fops->open=open_qp;


And when loading this module. The procfs gets broken. I get EINVAL for open on /proc/meminfo and all other procfs info. Why? Should procfs inodes don't have full filesematics? And it don't help to unload the module.

Strange. And a look in generic.c in fs/proc/

static struct file_operations proc_file_operations = { llseek: proc_file_lseek, read: proc_file_read, write: proc_file_write, };

Is this saying that we can not have the other fops on procfs inodes? No ioctl,open ?

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 07 2003 - 22:00:12 EST