kern/163076: It is not possible to read in chunks from linprocfs
and procfs.
Petr Salinger
Petr.Salinger at seznam.cz
Tue Dec 6 08:30:17 UTC 2011
The following reply was made to PR kern/163076; it has been noted by GNATS.
From: Petr Salinger <Petr.Salinger at seznam.cz>
To: Jaakko Heinonen <jh at FreeBSD.org>
Cc: Poul-Henning Kamp <phk at phk.freebsd.dk>, bug-followup at FreeBSD.org
Subject: Re: kern/163076: It is not possible to read in chunks from linprocfs
and procfs.
Date: Tue, 6 Dec 2011 09:38:49 +0100 (CET)
>>> Yes, r222004 changed sbuf_finish() to not clear s->s_error which causes
>>> the regression. I am not sure if we should blame r222004 or the pseudofs
>>> code.
The "dd testcase" works for us with change bellow.
It also solves the original problem.
I am unsure whether it is a right way, though.
Petr
--- a/sys/fs/pseudofs/pseudofs_vnops.c
+++ b/sys/fs/pseudofs/pseudofs_vnops.c
@@ -640,7 +640,7 @@
if (buflen > MAXPHYS + 1)
buflen = MAXPHYS + 1;
- sb = sbuf_new(sb, NULL, buflen, 0);
+ sb = sbuf_new(sb, NULL, MAXPHYS + 1, 0);
if (sb == NULL) {
error = EIO;
goto ret;
@@ -654,7 +654,12 @@
}
sbuf_finish(sb);
- error = uiomove_frombuf(sbuf_data(sb), sbuf_len(sb), uio);
+
+ if (buflen > sbuf_len(sb))
+ buflen = sbuf_len(sb);
+ else
+ buflen--;
+ error = uiomove_frombuf(sbuf_data(sb), buflen, uio);
sbuf_delete(sb);
ret:
vn_lock(vn, locked | LK_RETRY);
More information about the freebsd-bugs
mailing list