On 7 Apr 2025, at 11:57, Jeff Layton wrote: > Emulating flock locks over NFS locking is entirely a client-side > endeavor. The server isn't aware of it. The job on the server side is > to conform to the protocol. > > In this case, I think failing exclusive flock() locks when the client > doesn't have the file open for write is the correct thing to do, as I > think the protocol requires this. > > At one time, nfs_flock would reject those on the client, until this > patch reverted that behavior: That behavior existed for only a short time (6 months?) until the revert. > fcfa447062b2 NFS: Revert "NFS: Move the flock open mode check into nfs_flock()" > > I'm not sure that reverting that was the correct thing to do. NFS/NLM > locking generally follows fcntl() semantics. ISTM that we shouldn't > allow locks that fall outside of those semantics. I don't remember the details other than we submitted that revert after regression testing showed the original changed v3 behavior. Is it possible that some existing v3 server would use flock semantics for NLM? Ben