lkml.org 
[lkml]   [2009]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Q. Switch open_exec() and sys_uselib() to do_open_filp()
On Mon, May 11, 2009 at 11:46:15AM +0900, hooanon05@yahoo.co.jp wrote:
> My poor English may make me misunderstood.
> Please let me make sure.
> Do you mean FMODE_EXEC was passed to struct file before this commit?
>
> Previous open_exec() used to call
> file = nameidata_to_filp(&nd, O_RDONLY|O_LARGEFILE)
> and it calls
> filp = __dentry_open(nd->path.dentry, nd->path.mnt, flags, filp,
> NULL);
> __dentry_open()
> {
> f->f_flags = flags;
> f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK |
> FMODE_PREAD | FMODE_PWRITE;
> ;;;
> }
>
> So FMODE_EXEC was not set to f_flags/f_mode, O_RDONLY|O_LARGEFILE only.

Nope. It ended up in nd->intent.open.flags due to path_lookup_open().
Then lookup_instantiate_filp() from a filesystem that might care about
intents did
nd->intent.open.file = __dentry_open(dget(dentry), mntget(nd->mnt),
nd->intent.open.flags - 1,
nd->intent.open.file,
open);
and nameidata_to_filp() ended up picking nd->intent.open.file.

So f_flags is exactly where that thing used to end up, if it ended up
anywhere at all.


\
 
 \ /
  Last update: 2009-05-11 06:03    [W:0.151 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site