Re: NFS locking failure (not the 2.1.127 thinko).

H.J. Lu (hjl@lucon.org)
Tue, 10 Nov 1998 08:15:03 -0800 (PST)


>
>
> For some reason, I can't use NFS locking on files that aren't world-readable.
>
> The server complains like this:
> fh_verify: testlock/file1 permission failure, acc=4, error=218103808
>
> This is what I did:
>
> devel2 /homes/dwmw2/testlock $ touch file1
> devel2 /homes/dwmw2/testlock $ ls -l file1
> -rw-rw-r-- 1 dwmw2 dwmw2 0 Nov 9 11:40 file1
> devel2 /homes/dwmw2/testlock $ testlk -w file1
> fcntl: ok
>
> devel2 /homes/dwmw2/testlock $ chmod o-r file1
> devel2 /homes/dwmw2/testlock $ testlk -w file1
> fcntl: No locks available
> devel2 /homes/dwmw2/testlock $ ls -l file1
> -rw-rw---- 1 dwmw2 dwmw2 0 Nov 9 11:40 file1
> devel2 /homes/dwmw2/testlock $ id
> uid=2005(dwmw2) gid=2005(dwmw2) groups=2005(dwmw2),100(users),1000(html),101(integrale),1001(cvs)
> devel2 /homes/dwmw2/testlock $
>

# ls -l foo
-rw-rw-r-- 1 hjl staff 0 Nov 10 08:04 foo
./testlk.x86 -w foo
# chmod o-r foo
# ls -l foo
-rw-rw---- 1 hjl staff 0 Nov 10 08:04 foo
# ./testlk.x86 -w foo
fcntl: ok
# df .
Filesystem 1024-blocks Used Available Capacity Mounted on
ocean:/home/work/linux
2020332 1622830 393406 80% /net/ocean/linux

>
> I thought that the way round this would be to make the directory
> non-world-readable, but it still happens.
>
> Using read locks instead doesn't help. Being root doesn't help. The
> filesystem is exported with no_root_squash.
>
> Client and server are both 2.1.127 with the trivial patch that I sent last
> night to fix the timeout problems. knfsd is knfsd-981022, with the patches
> posted by HJL at Fri, 6 Nov 1998 09:53:56 -0800 (PST). Client and server are
> both running the rpc.kstatd contained therein.

You need to apply my all my kernel patches unless it is stated not
to do so for your kernel version. They are

1. linux-2.1.1xx.diff
2. lock-2.1.1xx.diff
3. nullproc-2.1.1xx.diff
4. quota-2.1.1xx.diff
5. root-2.1.1xx.diff
6. socket-2.1.1xx.diff

I will clean them up and send them to Linus when I find time and
the kernel is stable again.

>
> Given that the only reason I spent the weekend mucking about with knfsd was so
> that our users' mail spools could be locked, It's not been particularly useful
> so far :)

# df /var/spool/mail
Filesystem 1024-blocks Used Available Capacity Mounted on
ocean:/var/spool/mail
85520 17355 63749 21% /var/spool/mail

That is one main reason why I fixed knfsd :-). Because I am using it.

>
>
> Another problem I'm having is that the filesystems don't get properly exported
> when the server is rebooted. Some clients seem to get excluded, and even though
> the server is told to export 10.0.0.0/255.0.0.0, it seems to ignore some of
> them, so they get refused access until they remount.
>

You need read NEW and use rc.nfsd/rc.nfsfs under etc in knfsd.
It is not a problem for me.

-- 
H.J. Lu (hjl@gnu.org)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/