From 365585637af54c1ea03c7ac0b7412489717bb5a7 Mon Sep 17 00:00:00 2001 From: iedowse Date: Tue, 24 Jun 2003 19:04:26 +0000 Subject: Fix a bug in nfsrv_read() that caused the replies to certain NFSv3 short read operations at the end of a file to not have the "eof" flag set as they should. The problem is that the requested read count was compared against the rounded-up reply data length instead of the actual reply data length. This bug appears to have been introduced in revision 1.78 (June 1999). It causes first-time reads of certain file sizes (e.g 4094 bytes) to fail with EIO on a RedHat 9.0 NFSv3 client. MFC after: 1 week --- sys/nfsserver/nfs_serv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/nfsserver') diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 9384016..902dafc 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -954,7 +954,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, nfsm_adj(mb, len - tlen, tlen - cnt); if (v3) { *tl++ = txdr_unsigned(cnt); - if (len < reqlen) + if (cnt < reqlen) *tl++ = nfsrv_nfs_true; else *tl++ = nfsrv_nfs_false; -- cgit v1.1