From: Al Viro <viro@ZenIV.linux.org.uk>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: [heads-up] mknod() broken on nfs4
Date: Wed, 22 Jun 2011 00:59:00 +0100 [thread overview]
Message-ID: <20110621235900.GB11521@ZenIV.linux.org.uk> (raw)
Try mknod(path, 0777, 0); with path leading into nfs4. It
leads to call of nfs_open_create(), with nd->intent.open.file being
uninitialized. Note that LOOKUP_CREATE is set and so's LOOKUP_EXCL,
but LOOKUP_OPEN isn't. So nfs_atomic_lookup() falls through to
nfs_lookup(), which sees that we are doing exclusive create and just
does d_instantiate(dentry, NULL) and do nothing else. And then
we hit ->create()...
Results are ugly - random errors (often -EINVAL or -ENOENT)
and possibility of memory corruption if we manage to generate a request
that won't fail on server.
The really interesting question is what should we pass in
NFS_PROTO(dir)->create() in open_flags. I suspect that you are
checking the wrong flag there (LOOKUP_CREATE instead of LOOKUP_OPEN),
but I'm not sure what *should* be passed when LOOKUP_OPEN is not
there...
next reply other threads:[~2011-06-21 23:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-21 23:59 Al Viro [this message]
2011-06-22 0:23 ` [heads-up] mknod() broken on nfs4 Al Viro
2011-06-22 23:00 ` Trond Myklebust
2011-06-22 23:00 ` Trond Myklebust
2011-06-22 23:19 ` Al Viro
2011-06-22 23:19 ` Al Viro
2011-06-23 2:48 ` Al Viro
2011-06-23 5:37 ` Al Viro
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=20110621235900.GB11521@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=Trond.Myklebust@netapp.com \
--cc=linux-fsdevel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.