From 09860e8f80d095e94bc15d9b67e708cc77fab16f Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Thu, 10 Jul 2025 18:36:39 +0200 Subject: nfs: Fix write encoding for v3 --- nfs/ops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'nfs/ops.c') diff --git a/nfs/ops.c b/nfs/ops.c index a34d905a..6e5bfeb1 100644 --- a/nfs/ops.c +++ b/nfs/ops.c @@ -537,12 +537,17 @@ netfs_attempt_write (struct iouser *cred, struct node *np, p = xdr_encode_fhandle (p, &np->nn->handle); if (protocol_version == 2) + { *(p++) = 0; - *(p++) = htonl (offset); - if (protocol_version == 2) + *(p++) = htonl (offset); *(p++) = 0; - if (protocol_version == 3) + } + else + { + p = xdr_encode_64bit(p, offset); + *(p++) = htonl (thisamt); *(p++) = htonl (FILE_SYNC); + } p = xdr_encode_data (p, data, thisamt); err = conduct_rpc (&rpcbuf, &p); -- cgit v1.2.3