Date: Tue, 6 Dec 2011 08:30:17 GMT From: Petr Salinger <Petr.Salinger@seznam.cz> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/163076: It is not possible to read in chunks from linprocfs and procfs. Message-ID: <201112060830.pB68UH9o002267@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/163076; it has been noted by GNATS.
From: Petr Salinger <Petr.Salinger@seznam.cz>
To: Jaakko Heinonen <jh@FreeBSD.org>
Cc: Poul-Henning Kamp <phk@phk.freebsd.dk>, bug-followup@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112060830.pB68UH9o002267>
