The branch main has been updated by rmacklem:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=56c8c19046c46cb9e89c2a3967f8cf2cd0ace428

commit 56c8c19046c46cb9e89c2a3967f8cf2cd0ace428
Author:     Rick Macklem <rmack...@freebsd.org>
AuthorDate: 2025-02-19 23:34:53 +0000
Commit:     Rick Macklem <rmack...@freebsd.org>
CommitDate: 2025-02-19 23:34:53 +0000

    nfscl: Return appropriate reply status for NFSv4.1 callbacks
    
    Certain NFSv4.1 callbacks are not currently supported/used
    by the FreeBSD client.  Without this patch, NFS4ERR_NOTSUPP
    is replied for the callbacks.  Since NFSv4.1 does not specify
    all of these callbacks as optional, I think it is preferable
    to reply NFS_OK or NFS4ERR_REJECT_DELEG instead of NFS4ERR_NOTSUPP.
    
    This patch changes the reply status for these unsupported
    callbacks, which the client has no use for.
    
    I am not aware of any NFSv4.1 servers that will perform
    any of these callbacks against the FreeBSD client at this time.
    
    MFC after:      2 weeks
---
 sys/fs/nfsclient/nfs_clstate.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 16d201d65b34..7d1aab753628 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -3989,6 +3989,25 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p)
                                NFSUNLOCKCLSTATE();
                        }
                        break;
+               case NFSV4OP_CBNOTIFY:
+               case NFSV4OP_CBRECALLOBJAVAIL:
+               case NFSV4OP_CBNOTIFYLOCK:
+                       /*
+                        * These callbacks are not necessarily optional,
+                        * so I think it is better to reply NFS_OK than
+                        * NFSERR_NOTSUPP.
+                        * All provide information for which the FreeBSD client
+                        * does not currently have a use.
+                        * I am not sure if any of these could be generated
+                        * by a NFSv4.1/4.2 server for this client?
+                        */
+                       error = 0;
+                       NFSCL_DEBUG(1, "unsupp callback %d\n", op);
+                       break;
+               case NFSV4OP_CBPUSHDELEG:
+                       error = NFSERR_REJECTDELEG;
+                       NFSCL_DEBUG(1, "unsupp callback %d\n", op);
+                       break;
                default:
                        if (i == 0 && minorvers != NFSV4_MINORVERSION)
                                error = NFSERR_OPNOTINSESS;

Reply via email to