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:26 AM 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.



--


Assaf Yaari

assafy@google.com

SWE

+972-54-2444-360