linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* a BUG in mknod(./node_1077,0100777,0),
@ 2011-07-29 15:56 Mrbuddy
  2011-07-29 17:33 ` Trond Myklebust
  0 siblings, 1 reply; 2+ messages in thread
From: Mrbuddy @ 2011-07-29 15:56 UTC (permalink / raw)
  To: linux-nfs



HI:
 
When I use mknod(./node_1077,0100777,0), it return a error       errno=2:No such file or directory.
Mode 0100777 means create a common file.so I compared it with touch.
 
I found that when calling nfs4_do_open,in touch the flag is 0x8482,but in mknod,the flag is 0x40.
When calling mknod,the flag come from function nfs_create,

if((nd->flags & LOOKUP_CREATE) !=0)
     open_flags = nd->intent.open.flags;

so i guess can I add a flags at here as below:

if((nd->flags & LOOKUP_CREATE) !=0)
     open_flags = nd->intent.open.flags | O_CREAT | F_WRLCK;

with this change, mknod(./node_1077,0100777,0) return success.
look forward to your reply. 		 	   		  

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

* Re: a BUG in mknod(./node_1077,0100777,0),
  2011-07-29 15:56 a BUG in mknod(./node_1077,0100777,0), Mrbuddy
@ 2011-07-29 17:33 ` Trond Myklebust
  0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2011-07-29 17:33 UTC (permalink / raw)
  To: Mrbuddy; +Cc: linux-nfs

On Fri, 2011-07-29 at 15:56 +0000, Mrbuddy wrote: 
> 
> HI:
>  
> When I use mknod(./node_1077,0100777,0), it return a error       errno=2:No such file or directory.
> Mode 0100777 means create a common file.so I compared it with touch.
>  
> I found that when calling nfs4_do_open,in touch the flag is 0x8482,but in mknod,the flag is 0x40.
> When calling mknod,the flag come from function nfs_create,
> 
> if((nd->flags & LOOKUP_CREATE) !=0)
>      open_flags = nd->intent.open.flags;
> 
> so i guess can I add a flags at here as below:
> 
> if((nd->flags & LOOKUP_CREATE) !=0)
>      open_flags = nd->intent.open.flags | O_CREAT | F_WRLCK;
> 
> with this change, mknod(./node_1077,0100777,0) return success.
> look forward to your reply. 		 	   		  

Isn't this issue already fixed in mainline by commit f7c85868fc (fix
mknod() on nfs4 (hopefully))?

  Trond
-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com


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

end of thread, other threads:[~2011-07-29 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-29 15:56 a BUG in mknod(./node_1077,0100777,0), Mrbuddy
2011-07-29 17:33 ` Trond Myklebust

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