public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: hooanon05@yahoo.co.jp
Cc: linux-kernel@vger.kernel.org
Subject: Re: Q. Switch open_exec() and sys_uselib() to do_open_filp()
Date: Mon, 11 May 2009 07:52:07 +0100	[thread overview]
Message-ID: <20090511065207.GJ8633@ZenIV.linux.org.uk> (raw)
In-Reply-To: <7134.1242019209@jrobl>

On Mon, May 11, 2009 at 02:20:09PM +0900, hooanon05@yahoo.co.jp wrote:
> 
> Al Viro:
> > Nope.  It ended up in nd->intent.open.flags due to path_lookup_open().
> 
> Yes.
> 
> 
> > 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.
> 
> FS supporting lookup_instantiate_filp() is rare, isn't it?
> Simple grep told me it is called by fuse, nfsv4, cifs, and 9p only.
> In other FS, FMODE_EXEC was dropped since nameidata_to_filp() (from
> open_exec() directly) doesn't pick intent.open.flags up.

The rest of filesystems simply ignore FMODE_EXEC completely, no matter where
it is.
 
> Anyway, I could confirm that setting FMODE_EXEC to f_flags is intended.
> Thank you for your quick responces.

NOTE: "intended" != "is promised to stay that way".  Indeed, this thread is
an excellent demonstration of the reasons for massaging the entire nightmare
into saner shape.  The call graph in the current form is an obscenity, the
number of possible codepaths is way too high, thanks to the intents mess and
the paths taken by the data are interesting and hard to trace, to put it
very mildly.

The things *will* change, and final destination of FMODE_EXEC may very well
be among those.  The commit in question did the following:
	* eliminate two special codepaths
	* make FMODE_EXEC treatment consistent (it's always propagated to
f_flags) without functionality changes (filesystems that ignored the intents
are ignoring that bit in f_flags completely anyway).

We might end up changing the treatment of that thing and it might very well
end up in f_mode.  However, that would be a separate patch and it's not for
this point in cycle.

      reply	other threads:[~2009-05-11  6:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11  0:55 Q. Switch open_exec() and sys_uselib() to do_open_filp() hooanon05
2009-05-11  1:28 ` Al Viro
2009-05-11  2:46   ` hooanon05
2009-05-11  4:00     ` Al Viro
2009-05-11  5:20       ` hooanon05
2009-05-11  6:52         ` Al Viro [this message]

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=20090511065207.GJ8633@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=hooanon05@yahoo.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    /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