Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 May 2021 00:43:15 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: bbd5039e9197 - stable/13 - nfsd: fix stripe size reply for the File Layout pNFS server
Message-ID:  <202105040043.1440hFA7091319@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by rmacklem:

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

commit bbd5039e919728c739d717344f2183c29d142f89
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2021-04-20 00:51:07 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2021-05-04 00:40:01 +0000

    nfsd: fix stripe size reply for the File Layout pNFS server
    
    At a recent testing event I found out that I had misinterpreted
    RFC5661 where it describes the stripe size in the File Layout's
    nfl_util field. This patch fixes the pNFS File Layout server
    so that it returns the correct value to the NFSv4.1/4.2 pNFS
    enabled client.
    
    This affects almost no one, since pNFS server configurations
    are rare and the extant pNFS aware NFS clients seemed to
    function correctly despite the erroneous stripe size.
    It *might* be needed for correct behaviour if a recent
    Linux client mounts a FreeBSD pNFS server configuration
    that is using File Layout (non-mirrored configuration).
    
    (cherry picked from commit 5a89498d19863d0c4cb074f9b93862a70040bf1b)
---
 sys/fs/nfsserver/nfs_nfsdstate.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index fa7bb3ba9f56..60647ab288d8 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -6873,14 +6873,8 @@ nfsrv_filelayout(struct nfsrv_descript *nd, int iomode, fhandle_t *fhp,
 	NFSBCOPY(devid, tl, NFSX_V4DEVICEID);		/* Device ID. */
 	tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED);
 
-	/*
-	 * Make the stripe size as many 64K blocks as will fit in the stripe
-	 * mask. Since there is only one stripe, the stripe size doesn't really
-	 * matter, except that the Linux client will only handle an exact
-	 * multiple of their PAGE_SIZE (usually 4K).  I chose 64K as a value
-	 * that should cover most/all arches w.r.t. PAGE_SIZE.
-	 */
-	*tl++ = txdr_unsigned(NFSFLAYUTIL_STRIPE_MASK & ~0xffff);
+	/* Set the stripe size to the maximum I/O size. */
+	*tl++ = txdr_unsigned(NFS_SRVMAXIO & NFSFLAYUTIL_STRIPE_MASK);
 	*tl++ = 0;					/* 1st stripe index. */
 	pattern_offset = 0;
 	txdr_hyper(pattern_offset, tl); tl += 2;	/* Pattern offset. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105040043.1440hFA7091319>