svn commit: r276328 - stable/9/sys/fs/nfs

Peter Jeremy peterj at FreeBSD.org
Sun Dec 28 07:16:49 UTC 2014


Author: peterj
Date: Sun Dec 28 07:16:48 2014
New Revision: 276328
URL: https://svnweb.freebsd.org/changeset/base/276328

Log:
  MFH r275941:
  Adjust the test of a KASSERT to better match the intent.
  
  This assertion was added in r246213 as a guard against corrupted mbufs
  arriving from drivers, the key distinguishing factor of said mbufs being
  that they had a negative length. Given we're in a while loop specifically
  designed to skip over zero-length mbufs, panicking on a zero-length mbuf
  seems incorrect.
  
  Suggested by:	rmacklem
  MFH go-ahead:	benno
  Approved by:	grog (co-mentor)

Modified:
  stable/9/sys/fs/nfs/nfs_commonsubs.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- stable/9/sys/fs/nfs/nfs_commonsubs.c	Sun Dec 28 07:14:38 2014	(r276327)
+++ stable/9/sys/fs/nfs/nfs_commonsubs.c	Sun Dec 28 07:16:48 2014	(r276328)
@@ -200,7 +200,8 @@ nfsm_mbufuio(struct nfsrv_descript *nd, 
 				}
 				mbufcp = NFSMTOD(mp, caddr_t);
 				len = mbuf_len(mp);
-				KASSERT(len > 0, ("len %d", len));
+				KASSERT(len >= 0,
+				    ("len %d, corrupted mbuf?", len));
 			}
 			xfer = (left > len) ? len : left;
 #ifdef notdef


More information about the svn-src-stable-9 mailing list