Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Dec 2014 07:16:49 +0000 (UTC)
From:      Peter Jeremy <peterj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r276328 - stable/9/sys/fs/nfs
Message-ID:  <201412280716.sBS7GnPB085221@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412280716.sBS7GnPB085221>