linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [heads-up] mknod() broken on nfs4
@ 2011-06-21 23:59 Al Viro
  2011-06-22  0:23 ` Al Viro
  0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2011-06-21 23:59 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-fsdevel

	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...

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-23  5:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21 23:59 [heads-up] mknod() broken on nfs4 Al Viro
2011-06-22  0:23 ` Al Viro
     [not found]   ` <20110622002359.GC11521-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2011-06-22 23:00     ` Trond Myklebust
     [not found]       ` <1308783620.25875.30.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>
2011-06-22 23:19         ` Al Viro
2011-06-23  2:48           ` Al Viro
2011-06-23  5:37           ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).