diff options
author | Jaakko Heinonen <jh@FreeBSD.org> | 2010-01-22 08:45:12 +0000 |
---|---|---|
committer | Jaakko Heinonen <jh@FreeBSD.org> | 2010-01-22 08:45:12 +0000 |
commit | e48fbf26e8940e6273461aaa13820ead71d7243c (patch) | |
tree | 2322d5efcb24be04af2f196a2e1269c1a321cec5 | |
parent | 663fdad84b74c797f35a07b8da5be7d78b968df4 (diff) | |
download | src-e48fbf26e8940e6273461aaa13820ead71d7243c.tar.gz src-e48fbf26e8940e6273461aaa13820ead71d7243c.zip |
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)
Notes
Notes:
svn path=/head/; revision=202783
-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 34ca500c985a..5854378336cf 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) { |