[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120611190902.GA19869@redhat.com>
Date: Mon, 11 Jun 2012 21:09:02 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Al Viro <viro@...IV.linux.org.uk>
Cc: linuxppc-dev@...ts.ozlabs.org, lkml <linux-kernel@...r.kernel.org>,
michael@...erman.id.au, antonb@...nktux.localdomain,
Paul Mackerras <paulus@...ba.org>, benh@...nel.crashing.org,
Ingo Molnar <mingo@...e.hu>, peterz@...radead.org,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
Jim Keniston <jkenisto@...ibm.com>
Subject: Q: a_ops->readpage() && struct file
On 06/11, Oleg Nesterov wrote:
>
> Note also that we should move this !UPROBE_COPY_INSN from
> install_breakpoint() to somewhere near alloc_uprobe().
The main problem is, uprobe_register() doesn't have struct file
for read_mapping_page().
Stupid question. I'm afraid the answer is "no" but I'll ask anyway.
Is it safe to pass filp == NULL to mapping->readpage()? In fact
I do not understand why it needs "struct file*" and I do not see
any example of actual usage. Yes, I didn't try to grep very much
and I understand that the filesystem can do something special.
Say it can use file->private_data...
However. There is read_cache_page_gfp() which does use
a_ops->readpage(filp => NULL), and the comment says nothing about
the riskiness.
If not, is there any other way
uprobe_register(struct inode *inode, loff_t offset) can read the
page at this offset?
And btw, read_mapping_page() accepts "void *data". Why? it uses
filler == a_ops->readpage, it shouldn't accept anything but file
pointer?
Please help, I know nothing about vfs.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists