diff options
author | jh <jh@FreeBSD.org> | 2010-01-22 08:45:12 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2010-01-22 08:45:12 +0000 |
commit | 03418e0c500f91bed6a159d72bf28c6b31fcdec4 (patch) | |
tree | 2322d5efcb24be04af2f196a2e1269c1a321cec5 /sys/fs/pseudofs | |
parent | 01ee00225ce30babfed9f4ff5ad883404c9ce707 (diff) | |
download | FreeBSD-src-03418e0c500f91bed6a159d72bf28c6b31fcdec4.zip FreeBSD-src-03418e0c500f91bed6a159d72bf28c6b31fcdec4.tar.gz |
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)
Diffstat (limited to 'sys/fs/pseudofs')
-rw-r--r-- | sys/fs/pseudofs/pseudofs_vnops.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index 34ca500..5854378 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -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) { |