nfs NLM locks greater than 8 bytes

From: Bill Akers
Date: Mon Nov 03 2003 - 19:53:25 EST

Hash: SHA1

Has anyone looked at the NFS NLM byte lock size issue between the Linux kernel
based NFS server and BSD 5 clients? BSD 5 uses a large cookie for locking
(16 or even 20 bytes). Linux automatically rejects any lock attempts with a
cookie over 8 bytes. This issue has become important for us because of
Apple's release of OS X 10.3 (Panther), which is based on BSD 5.

Jonathan Lennox summed it up pretty well on the Freebsd bug list:

> Linux's implementation of NFS NLM locks is buggy: it doesn't support lock
> cookies longer than 8 bytes in size. See the comment in
> <> on the
> definition of 'struct nlm_cookie': "NLM cookies. Technically they can be 1K,
> Nobody uses over 8 bytes however."
> Unfortunately, this is actually "nobody" except FreeBSD 5.x, which uses
> 16-byte cookies. As a result, any attempt by a FreeBSD client to lock an
> NFS-mounted file from a Linux server results in the process on the FreeBSD
> client hanging, unkillably.

His full original post is:

I have checked out every recent version of the kernel on (2.4 and
2.6) and haven't seen any modifications to xdr.h or xdr.c that might address
this issue. Nor have I been able to find any posts on Linux lists that
discuss the issue. There is a BSD patch to dumb down their client code and
make the cookie size smaller. The fear being that it will take a long time
to get a linux patch into the kernel. But if no one has even brought up the
issue here, it will certainly take forever. :-)

I can probably dust off enough of my old coding skills to up the check from 8
bytes to some higher number (16, 20, 1024 bytes?). But I certainly don't
know enough about the Linux kernel to know what ramifications that will have.


- --
Bill Akers
Director of Network Operations
UCLA Graduate School of Education and Information Studies
Version: GnuPG v1.0.7 (GNU/Linux)


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at