shithub: riscv

Download patch

ref: ee86d3cb52aa63b8db74ec0577f355f091b2e227
parent: b86a12149ade500326a238753c31b6e0178d3b5b
author: cinap_lenrek <[email protected]>
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;