Date: Fri, 19 Dec 2014 19:09:23 +0000 (UTC) From: Benno Rice <benno@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275941 - head/sys/fs/nfs Message-ID: <201412191909.sBJJ9N60005439@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: benno Date: Fri Dec 19 19:09:22 2014 New Revision: 275941 URL: https://svnweb.freebsd.org/changeset/base/275941 Log: 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. No objection from: kib Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Dec 19 18:45:52 2014 (r275940) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Dec 19 19:09:22 2014 (r275941) @@ -219,7 +219,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?201412191909.sBJJ9N60005439>