git: 9front

Download patch

ref: 4f17bd2cd1caf37eb2a8609d7882600fa1cafb3e
parent: 6456b1453214ae7b26b3ba9d7bae3c7b9d598dbe
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jul 30 17:00:13 EDT 2015

devmnt: fix mntcache()

make sure mntcache() wont cache data beyond what was read from
the block list.

--- a/sys/src/9/port/devmnt.c
+++ b/sys/src/9/port/devmnt.c
@@ -669,8 +669,7 @@
 		m = r->reply.count;
 		if(m > r->request.count)
 			m = r->request.count;
-
-		for(b = r->b; m > 0 && b != nil; b = b->next) {
+		for(b = r->b; m > 0 && b != nil; m -= n, b = b->next) {
 			n = BLEN(b);
 			if(m < n)
 				n = m;
--