diff options
author | Benno Rice <benno@FreeBSD.org> | 2014-12-19 19:09:22 +0000 |
---|---|---|
committer | Benno Rice <benno@FreeBSD.org> | 2014-12-19 19:09:22 +0000 |
commit | 6d659a5d9bf34dabb20d9c7d111f017bd1fb9230 (patch) | |
tree | e58e0310b6724d2dad83c3b7abb8645e7e3e3bba /sys/fs | |
parent | e808299c020f25d822a737dea9c2b4ea1b1d2c50 (diff) | |
download | src-6d659a5d9bf34dabb20d9c7d111f017bd1fb9230.tar.gz src-6d659a5d9bf34dabb20d9c7d111f017bd1fb9230.zip |
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
Notes
Notes:
svn path=/head/; revision=275941
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfs/nfs_commonsubs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index d9f843611b31..0f6db3281026 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -219,7 +219,8 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio *uiop, int siz) } 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 |