git: f419fd9ad817 - stable/12 - nfsclient: Fix the stripe unit size for a File Layout pNFS layout
Rick Macklem
rmacklem at FreeBSD.org
Mon Mar 15 20:52:08 UTC 2021
The branch stable/12 has been updated by rmacklem:
URL: https://cgit.FreeBSD.org/src/commit/?id=f419fd9ad81707f831a48412ecbc5c958675d38c
commit f419fd9ad81707f831a48412ecbc5c958675d38c
Author: Rick Macklem <rmacklem at FreeBSD.org>
AuthorDate: 2021-03-01 20:49:32 +0000
Commit: Rick Macklem <rmacklem at FreeBSD.org>
CommitDate: 2021-03-15 19:51:26 +0000
nfsclient: Fix the stripe unit size for a File Layout pNFS layout
During a recent virtual NFSv4 testing event, a bug in the FreeBSD client
was detected when doing a File Layout pNFS DS I/O operation.
The size of the I/O operation was smaller than expected.
The I/O size is specified as a stripe unit size in bits 6->31 of nflh_util
in the layout. I had misinterpreted RFC5661 and had shifted the value
right by 6 bits. The correct interpretation is to use the value as
presented (it is always an exact multiple of 64), clearing bits 0->5.
This patch fixes this.
Without the patch, I/O through the DSs work, but the I/O size is 1/64th
of what is optimal.
(cherry picked from commit 94f2e42f5e0b78a7a4684d4a4eb62ea470a57eb1)
---
sys/fs/nfsclient/nfs_clrpcops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index e1c5c7ff3316..cab5ec4005ba 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -5911,7 +5911,7 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
np = VTONFS(vp);
rel_off = off - flp->nfsfl_patoff;
- stripe_unit_size = (flp->nfsfl_util >> 6) & 0x3ffffff;
+ stripe_unit_size = flp->nfsfl_util & NFSFLAYUTIL_STRIPE_MASK;
stripe_pos = (rel_off / stripe_unit_size + flp->nfsfl_stripe1) %
dp->nfsdi_stripecnt;
transfer = stripe_unit_size - (rel_off % stripe_unit_size);
More information about the dev-commits-src-all
mailing list