Date: Fri, 22 Jan 2010 08:45:12 +0000 (UTC) From: Jaakko Heinonen <jh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r202783 - head/sys/fs/pseudofs Message-ID: <201001220845.o0M8jC6v009730@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jh Date: Fri Jan 22 08:45:12 2010 New Revision: 202783 URL: http://svn.freebsd.org/changeset/base/202783 Log: Truncate read request rather than returning EIO if the request is larger than MAXPHYS + 1. This fixes a problem with cat(1) when it uses a large I/O buffer. Reported by: Fernando ApesteguĂa Suggested by: jilles Reviewed by: des Approved by: trasz (mentor) Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 22 07:53:41 2010 (r202782) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 22 08:45:12 2010 (r202783) @@ -637,10 +637,8 @@ pfs_read(struct vop_read_args *va) error = EINVAL; goto ret; } - if (buflen > MAXPHYS + 1) { - error = EIO; - goto ret; - } + if (buflen > MAXPHYS + 1) + buflen = MAXPHYS + 1; sb = sbuf_new(sb, NULL, buflen, 0); if (sb == NULL) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001220845.o0M8jC6v009730>