From 8097753476d28d1cdbe20a9c377f4071b0c52edd Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Sun, 10 Jun 2018 19:03:21 +0000 Subject: [PATCH] Add checks for the Flexible File layout to LayoutRecall callbacks. The Flexible File layout case wasn't handled by LayoutRecall callbacks because it just checked for File layout and returned NFSERR_NOMATCHLAYOUT otherwise. This patch adds the Flexible File layout handling. Found during testing of the pNFS server. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clstate.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index c72884482d99..702f81a0465b 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3422,9 +3422,12 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) else changed = 0; recalltype = fxdr_unsigned(int, *tl); + NFSCL_DEBUG(4, "layt=%d iom=%d ch=%d rectyp=%d\n", + laytype, iomode, changed, recalltype); recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_WAITOK); - if (laytype != NFSLAYOUT_NFSV4_1_FILES) + if (laytype != NFSLAYOUT_NFSV4_1_FILES && + laytype != NFSLAYOUT_FLEXFILE) error = NFSERR_NOMATCHLAYOUT; else if (recalltype == NFSLAYOUTRETURN_FILE) { error = nfsm_getfh(nd, &nfhp); @@ -3441,6 +3444,9 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) error = NFSERR_NOTSUPP; else if (i == 0) error = NFSERR_OPNOTINSESS; + NFSCL_DEBUG(4, "off=%ju len=%ju sq=%u err=%d\n", + (uintmax_t)off, (uintmax_t)len, + stateid.seqid, error); if (error == 0) { NFSLOCKCLSTATE(); clp = nfscl_getclntsess(sessionid); @@ -3453,7 +3459,8 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) lyp); if (lyp != NULL && (lyp->nfsly_flags & - NFSLY_FILES) != 0 && + (NFSLY_FILES | + NFSLY_FLEXFILE)) != 0 && !NFSBCMP(stateid.other, lyp->nfsly_stateid.other, NFSX_STATEIDOTHER)) {