From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] atomic open(..., O_CREAT | ...)
Date: Tue, 09 Aug 2005 17:11:30 -0400 [thread overview]
Message-ID: <1123621890.8245.211.camel@lade.trondhjem.org> (raw)
In-Reply-To: <E1E2aw6-0007oY-00@dorka.pomaz.szeredi.hu>
ty den 09.08.2005 Klokka 22:42 (+0200) skreiv Miklos Szeredi:
> Trond, wake up! __emul_lookup_dentry() does nothing of the sort.
> Neither does anything else. In theory it could, but that's not a
> reason to do a confusing thing like that.
Really?
static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
{
.....
if (path_walk(name, nd) == 0) {
if (nd->dentry->d_inode) {
dput(old_dentry);
mntput(old_mnt);
return 1;
}
path_release(nd);
}
nd->dentry = old_dentry;
nd->mnt = old_mnt;
nd->last = last;
nd->last_type = last_type;
}
return 1;
}
Which is called by path_lookup(), which again returns success, and
expects the user to call path_release() later.
> > Firstly, the open_namei() flags field is not a "permissions" field. It
> > contains open mode information. The calculation of the open permissions
> > flags is done by open_namei() itself.
>
> Based on flags. It's just a FMODE_* -> MAY_* transformation
>
> > Secondly, what advantage is there in allowing callers of open_namei() to
> > be able to override the MAY_WRITE check when doing open(O_TRUNC)? This
> > is a calculation that should be done _once_ in order to always get it
> > right, and it should therefore be done in open_namei() together with the
> > rest of the permissions calculation.
>
> I think the _only_ caller of open_namei() is filp_open(), so this is
> not much of an issue, but yeah, you could do it that way too.
Currently, yes. The only caller of open_namei() is filp_open(). That was
not always the case previously.
If we think it will never be the case in the future, then there is an
argument for merging the two and/or making open_namei() and inlined
function.
Cheers,
Trond
next prev parent reply other threads:[~2005-08-09 21:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-08 22:27 Miklos Szeredi
2005-08-08 22:58 ` Trond Myklebust
2005-08-09 7:46 ` Miklos Szeredi
2005-08-09 13:34 ` Trond Myklebust
2005-08-09 15:47 ` Bryan Henderson
2005-08-09 16:07 ` Trond Myklebust
2005-08-09 16:34 ` Bryan Henderson
2005-08-09 16:40 ` Miklos Szeredi
2005-08-09 17:18 ` Trond Myklebust
2005-08-09 17:44 ` Miklos Szeredi
2005-08-09 18:38 ` Trond Myklebust
2005-08-09 20:42 ` Miklos Szeredi
2005-08-09 21:11 ` Trond Myklebust [this message]
2005-08-09 21:19 ` Miklos Szeredi
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=1123621890.8245.211.camel@lade.trondhjem.org \
--to=trond.myklebust@fys.uio.no \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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
all inboxes | Powered by JetHome®