In https://www.rfc-editor.org/rfc/rfc8881.html#name-client-id-and-session-consi it is written:

In the case of a server with concurrent pNFS roles that are served by a common client ID, if the EXCHANGE_ID request from the client has zero or a combination of the bits set in eia_flags, the server result should set bits that represent the higher of the acceptable combination of the server roles, with a preference to match the roles requested by the client. Thus, if a client request has (EXCHGID4_FLAG_USE_NON_PNFS | EXCHGID4_FLAG_USE_PNFS_MDS | EXCHGID4_FLAG_USE_PNFS_DS) flags set, and the server is both a metadata server and a data server, serving both the roles by a common client ID, the server SHOULD return with (EXCHGID4_FLAG_USE_PNFS_MDS | EXCHGID4_FLAG_USE_PNFS_DS) set.
In the case of a server that has multiple concurrent pNFS roles, each role served by a unique client ID, if the client specifies zero or a combination of roles in the request, the server results SHOULD return only one of the roles from the combination specified by the client request. If the role specified by the server result does not match the intended use by the client, the client should send the EXCHANGE_ID specifying just the interested pNFS role.


My understanding from that, is that if the client did specify a flag in the eia_flags, then the server should match its capabilities to the requested flag.

Yet, maybe someone else with more experience than me with pNFS can share their POV. Frank?


P.s. my original change was just in order to pass compliance checks so if the server does not have any pNFS capabilities then it must return EXCHGID4_FLAG_USE_NON_PNFS. Before my change it returned 0 which violated the spec.
I haven't really changed the original capabilities matching logic.


On Thu, Aug 15, 2024 at 12:11 AM Marc Eshel <eshel@us.ibm.com> wrote:

I don’t think that we are violating the RFC but I think we can use better responses to the client.

My servers do both MDS and DS so this what I see going back to the client

 

  1. If eia_flags == 0

server_pnfs_flags |= EXCHGID4_FLAG_USE_PNFS_DS | EXCHGID4_FLAG_USE_PNFS_MDS

  

  1. If eia_flags == EXCHGID4_FLAG_USE_PNFS_DS

server_pnfs_flags |= EXCHGID4_FLAG_USE_PNFS_DS | EXCHGID4_FLAG_USE_NON_PNFS

 

I would expect that for both we would return

EXCHGID4_FLAG_USE_PNFS_DS | EXCHGID4_FLAG_USE_PNFS_MDS

 

   Marc.

 

 

From: Assaf Yaari <assafy@google.com>
Date: Wednesday, August 14, 2024 at 2:46
AM
To: Marc Eshel <eshel@us.ibm.com>
Cc: Frank Stewart Filz <ffilz@ibm.com>, devel@lists.nfs-ganesha.org <devel@lists.nfs-ganesha.org>
Subject: [EXTERNAL] Re: pNFS related commit a48cfbd5f9cfdf259136e0cf1f4bfc134ce8b8d8

Hi Marc, The case that the client did sent pNFS flag is covered by the 'else' of this condition: } /* If client did ask for pNFS related server roles than try to match the server roles to the client request. */ else { if ((arg_EXCHANGE_ID4->eia_flags

Hi Marc,

 

The case that the client did sent pNFS flag is covered by the 'else' of this condition:

}
/* If client did ask for pNFS related server roles than try to match the
   server roles to the client request. */
else {
         if ((arg_EXCHANGE_ID4->eia_flags & EXCHGID4_FLAG_USE_PNFS_MDS)
             && (nfs_param.nfsv4_param.pnfs_mds))
                server_pnfs_flags |= EXCHGID4_FLAG_USE_PNFS_MDS;
         else
                server_pnfs_flags |= EXCHGID4_FLAG_USE_NON_PNFS;
         if ((arg_EXCHANGE_ID4->eia_flags & EXCHGID4_FLAG_USE_PNFS_DS)
             && (nfs_param.nfsv4_param.pnfs_ds))
                server_pnfs_flags |= EXCHGID4_FLAG_USE_PNFS_DS;
}

 

I believe that the above conforms to RFC 8881 section 13.1. 

The first block section that you refer to, covers the case when the client doesn't send any pNFS flags so you should not modify the condition.

 

Regarding the other issue that you wrote - pNFS is NFSv4.1(2) specific so it seems to me reasonable that it will be in the NFSv4 config block.

Are you saying that you want the freedom to configure the pNFS abilities per share?

 

As our product doesn't support pNFS I don't have strong thoughts about that. I advise that you continue this discussion with Frank.

 

Regards,

Assaf Y.

 

On Wed, Aug 14, 2024 at 6:26AM Marc Eshel <eshel@us.ibm.com> wrote:

Hi Assf,

I believe that we need the following change in the code that you changed last year. I am starting to test pNFS and if the client has any flags on in the pNFS mask we should check the clients request.

 

diff --git a/src/Protocols/NFS/nfs4_op_exchange_id.c b/src/Protocols/NFS/nfs4_op_exchange_id.c

index 15bb386fe..a6b730308 100644

--- a/src/Protocols/NFS/nfs4_op_exchange_id.c

+++ b/src/Protocols/NFS/nfs4_op_exchange_id.c

@@ -172,7 +172,7 @@ enum nfs_req_result nfs4_op_exchange_id(struct nfs_argop4 *op,

 

        /* If client did not ask for pNFS related server roles than just set

           server roles */

-       if ((arg_EXCHANGE_ID4->eia_flags & EXCHGID4_FLAG_MASK_PNFS) == 0) {

+       if (arg_EXCHANGE_ID4->eia_flags & EXCHGID4_FLAG_MASK_PNFS) {

                if (nfs_param.nfsv4_param.pnfs_mds)

                        server_pnfs_flags |= EXCHGID4_FLAG_USE_PNFS_MDS;

                else

 

On another issue if you are familiar   with pNFS code, it is checking the pNFS flags only in the NFSv4 block

I think it should be at the  EXPORT block.

 

NFSv4

{

  PNFS_MDS = true;

   PNFS_DS = true;

}

 

Thanks, Marc.


 

--

 

Image removed by sender.

Assaf Yaari

assafy@google.com

SWE

+972-54-2444-360

 



--


Assaf Yaari

assafy@google.com

SWE

+972-54-2444-360