Re: nfs4 delegation - couple of questions - 6.10.3-custom kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2024-08-15 at 11:44 +0300, Roi Azarzar wrote:
> Thank you for the answer,
> 
> reg 1,  in which cases the server should increase the seqid in the
> delegation stateid then?
> 

Generally, never. Delegation stateids don't ever really change. They
are issued and then are eventually recalled, but nothing changes them
in a way that would require the seqid to morph. We have this comment in
alloc_init_deleg:

        /*
         * delegation seqid's are never incremented.  The 4.1 special
         * meaning of seqid 0 isn't meaningful, really, but let's avoid
         * 0 anyway just for consistency and use 1:
         */

So we set our deleg seqids to 1 and they never change.

> Another question regarding locks, in case the client has only write
> delegation stateid (for example while using WANT_DELEGATION or
> OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION), which means he can cache
> opens and locks, in case of a recall -  the stateid of the opens and
> the locks will be the stateid of the delegation ?
> 

They wouldn't have a stateid until you had established one with the
server. If a delegation is recalled, then the client is responsible for
issuing OPEN and LOCK calls to represent the opens and locks that had
been given out under the deleg. Once it has established stateful
objects with the server, it can return the delegation.


> On Wed, Aug 14, 2024 at 4:14 PM Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> > 
> > On Wed, 2024-08-14 at 08:46 +0300, Roi Azarzar wrote:
> > > scenario 1 that I tested - 2 opens from the same client different
> > > owners (pcap attached).
> > > I'm wondering what should be the behavior in case the server received
> > > 2 opens with access read with want_read_deleg.
> > > I thought the server should give the same delegation state in the 2nd
> > > open and increase the seqid but I see the server doesn't grant
> > > delegation at all, can you explain it please?
> > > 
> > 
> > An open stateid can only have one owner, so when you issue the OPEN
> > request with a different owner, the server has to issue you a new
> > stateid.
> > 
> > Delegations are a bit different, since they are issued to the client,
> > and not to a specific openowner. The server will not issue more than
> > one delegation to a client at a time, which is why it didn't issue one
> > here.
> > 
> > > Another behavior that I'm trying to understand is size,change  attrs
> > > in cb_getattr, I tested the following scenario:
> > > 
> > >  client 1 open for write
> > > client 1 write
> > > client 2 do stat on file
> > > client 1 write again
> > > client 2 do stat on file again
> > > 
> > > Each stat caused the serv to send cb_geattr but in the response from
> > > the client I saw the same change and size values, can you explain it?
> > > 
> > > both serv and client versions
> > > > 
> > > > ]$ uname -r
> > > > 6.10.3-custom
> > > 
> > 
> > That sounds like a client bug.
> > --
> > Jeff Layton <jlayton@xxxxxxxxxx>

-- 
Jeff Layton <jlayton@xxxxxxxxxx>





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux