lkml.org 
[lkml]   [2012]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [REGRESSION] NFSv4: open(O_TRUNC) hangs
Date
"Myklebust, Trond" <Trond.Myklebust@netapp.com> writes:

> Hi Miklos
>
> On Fri, 2012-04-06 at 11:43 +0200, Miklos Szeredi wrote:
>> "Myklebust, Trond" <Trond.Myklebust@netapp.com> writes:
>>
>> > The following client patch fixes the regression for me.
>>
>> It fixes the hang, but it still doesn't work 100% correctly. Try the
>> following test program.
>>
>> BTW, do you run any fs test suits? All these were caught with one I use
>> to quick test fuse (it's in the fuse git tree(*) under the "test"
>> directory). But I guess others like LTP would catch these as well.
>
> Thanks! I'll look into that. Bryan has been helping me to set up a test
> rig for the NFS client, but for now we don't have much coverage of basic
> POSIX tests.
>
>> Thanks,
>> Miklos
>>
>> (*) git://fuse.git.sourceforge.net/gitroot/fuse/fuse
>> ---
>>
>> #include <stdio.h>
>> #include <unistd.h>
>> #include <fcntl.h>
>> #include <errno.h>
>>
>> int main(int argc, char *argv[])
>> {
>> int res;
>> char *name = argv[1];
>>
>> unlink(name);
>> close(creat(name, 0400));
>> res = open(name, O_RDONLY | O_TRUNC);
>> if (res != -1 && errno != EPERM)
>> fprintf(stderr, "should have failed!\n");
>
> Shouldn't that be EACCES? As far as I know, POSIX doesn't list EPERM as
> an allowed return value for open().

Yes it should be EACCESS. That test is broken, it should be:

if (res != -1 || errno != EACCES)
The one in the fuse tree is correct though...

Thanks,
Miklos


\
 
 \ /
  Last update: 2012-04-19 13:29    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site