0

NFS v4.0 server enforces mandatory file locking because of which conflicting write operations by client are denied by server. How do I make NFS client aware that server enforces mandatory file lock so that client never perform conflicting write operations? Is there any configuration that can be set up to make this work?

I looked up all nfs4 mount options but there is no relevant option. NFS v2 and v3 support a mount option nolock but that is not supported by nfs4.

Shubham Gaikwad
  • 103
  • 2
  • 2
  • 9
  • If you're talking about Linux, the NFSv4 client is already locking-aware. If your app blocks on a lock, and you consider that a problem, that means you need to fix your app, not the client. – root May 31 '22 at 16:28
  • @root Is there any mount option for the NFS client that can disable mandatory locking? Something like `noman` or `no_man`? – Shubham Gaikwad Jul 21 '22 at 08:58
  • Not that I'm aware of. You might want to edit your question with the precise mount options you're using, the export options on the server, and the exact calls to `open()` and `write()` that your client apps use, so that you can get more specific answers. – root Jul 22 '22 at 04:24
  • There are mount options called `mand` and `nomand`. `mand` - Allow mandatory locks on this filesystem. See fcntl(2). `nomand` - Do not allow mandatory locks on this filesystem. These options when used to mount a NFS v4 export doesn't seem to have any effect. – Shubham Gaikwad Jul 22 '22 at 08:01

0 Answers0