From: Peter Enderborg <pme@hyglo.com>
To: linux-kernel@vger.kernel.org
Cc: "Theodore Ts'o" <tytso@mit.edu>, Linus Torvalds <torvalds@osdl.org>
Subject: Procfs open hook bug.
Date: Tue, 01 Jul 2003 12:55:04 +0200 [thread overview]
Message-ID: <3F016888.2080306@hyglo.com> (raw)
I have done this little patch for the procfs_example.c
diff procfs_example.c
kernels/linux-2.4.20/Documentation/DocBook/procfs_example.c
87,91d86
< static int open_qp(struct inode * inode, struct file * file)
< {
< printk("Open my node %p %p \n",inode,file);
< return -EINVAL;
< }
180c175
< 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 ?
next reply other threads:[~2003-07-01 10:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-01 10:55 Peter Enderborg [this message]
2003-07-01 18:33 ` Procfs open hook bug Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F016888.2080306@hyglo.com \
--to=pme@hyglo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox