aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2021-03-01 20:49:32 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2021-03-01 20:49:32 +0000
commit94f2e42f5e0b78a7a4684d4a4eb62ea470a57eb1 (patch)
tree08d479b1f99ea55e8d92dbc1dc7e3f39dc9b035e
parentc88c1f23a8989b881a5ca51223289ddb4ce74277 (diff)
downloadsrc-94f2e42f5e0b78a7a4684d4a4eb62ea470a57eb1.tar.gz
src-94f2e42f5e0b78a7a4684d4a4eb62ea470a57eb1.zip
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. MFC after: 2 weeks
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index c95d4dc58e7a..0e503e34810b 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -6024,7 +6024,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);