summaryrefslogtreecommitdiff
path: root/os/port/exportfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/port/exportfs.c')
-rw-r--r--os/port/exportfs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/os/port/exportfs.c b/os/port/exportfs.c
index 354574ef..c8755fa8 100644
--- a/os/port/exportfs.c
+++ b/os/port/exportfs.c
@@ -511,6 +511,7 @@ exslave(void*)
Export *fs;
Exq *q, *t, *fq, **last;
char *err;
+ int nstat;
for(;;){
qlock(&exq.qwait);
@@ -569,7 +570,11 @@ exslave(void*)
break;
case Tstat:
q->out.stat = q->buf + MSGHDRSZ + BIT16SZ; /* leaves it just where we want it */
- q->out.nstat = q->bsize-(MSGHDRSZ+BIT16SZ);
+ nstat = q->bsize;
+ if(nstat > STATMAX)
+ nstat = STATMAX;
+ nstat -= MSGHDRSZ+BIT16SZ;
+ q->out.nstat = nstat;
break;
}
err = (*fcalls[q->in.type])(fs, &q->in, &q->out);