On Thu, Jan 2, 2025 at 2:41 PM Jeff Layton <jlayton@xxxxxxxxxx> wrote: > > On Thu, 2025-01-02 at 11:08 +0200, Shaul Tamari wrote: > > Hi, > > > > I have a question regarding NFS4.1 write delegation stateid permission checks. > > > > Is there a difference in how a server should check permissions for a > > write delegation stateid that was given when the file was opened with: > > 1. OPEN4_SHARE_ACCESS_BOTH > > 2. OPEN4_SHARE_ACCESS_WRITE > > > > (cc'ing Sagi since he was looking at this recently) > > A write delegation really should have been called a read-write > delegation, because the server has to allow the client to do reads as > well, if you hold one. > > The Linux kernel nfs server doesn't currently give out delegations to > OPEN4_SHARE_ACCESS_WRITE-only opens for this reason. You have to > request BOTH in order to get one, because a permission check for write > is not sufficient to allow you to read as well. So a NFS4.1 client must replace OPEN4_SHARE_ACCESS_WRITE with OPEN4_SHARE_ACCESS_BOTH to get write delegations? Thanks, Martin