Date: Wed, 26 Apr 2017 21:54:54 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317465 - head/sys/fs/nfsclient Message-ID: <201704262154.v3QLssfr092285@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Wed Apr 26 21:54:53 2017 New Revision: 317465 URL: https://svnweb.freebsd.org/changeset/base/317465 Log: Fix handling of a NFSv4.1 callback reply from the session cache. The nfsv4_seqsession() call returns NFSERR_REPLYFROMCACHE when it has a reply in the session, due to a requestor retry. The code erroneously assumed a return of 0 for this case. This patch fixes this and adds a KASSERT(). This would be an extremely rare occurrence. It was found during code inspection during the pNFS server development. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Wed Apr 26 20:21:05 2017 (r317464) +++ head/sys/fs/nfsclient/nfs_clstate.c Wed Apr 26 21:54:53 2017 (r317465) @@ -3560,9 +3560,18 @@ nfscl_docb(struct nfsrv_descript *nd, NF tsep->nfsess_backslots); } NFSUNLOCKCLSTATE(); - if (error == 0) { + if (error == 0 || error == NFSERR_REPLYFROMCACHE) { gotseq_ok = 1; if (rep != NULL) { + /* + * Handle a reply for a retried + * callback. The reply will be + * re-inserted in the session cache + * by the nfsv4_seqsess_cacherep() call + * after out: + */ + KASSERT(error == NFSERR_REPLYFROMCACHE, + ("cbsequence: non-NULL rep")); NFSCL_DEBUG(4, "Got cbretry\n"); m_freem(nd->nd_mreq); nd->nd_mreq = rep;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704262154.v3QLssfr092285>