From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 1 19:38:17 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E34F106568F for ; Fri, 1 Jan 2010 19:38:17 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id C82EB8FC1A for ; Fri, 1 Jan 2010 19:38:16 +0000 (UTC) Received: from toad.stack.nl (toad.stack.nl [IPv6:2001:610:1108:5010::135]) by mx1.stack.nl (Postfix) with ESMTP id 17C101DD688; Fri, 1 Jan 2010 20:38:15 +0100 (CET) Received: by toad.stack.nl (Postfix, from userid 1677) id 0AFC473F9D; Fri, 1 Jan 2010 20:38:15 +0100 (CET) Date: Fri, 1 Jan 2010 20:38:14 +0100 From: Jilles Tjoelker To: Fernando =?iso-8859-1?Q?Apestegu=EDa?= Message-ID: <20100101193814.GA60021@stack.nl> References: <1bd550a01001010945i1a043ff9t70eb814cafe4b30a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1bd550a01001010945i1a043ff9t70eb814cafe4b30a@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: FreeBSD Hackers Subject: Re: linprocfs Input/output error X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jan 2010 19:38:17 -0000 On Fri, Jan 01, 2010 at 06:45:33PM +0100, Fernando Apesteguía wrote: > Hi all, I post here cause I didn't get any answers in freebsd-emulation. > In 8.0-RELEASE-p1 if I try to execute this: > cat /compat/linux/proc/cpuinfo > ~/cpuinfo.txt > I get > cat: /compat/linux/proc/cpuinfo: Input/output error > truss shows the read system call returns ERR#5. It is the same with > other files from linprocfs. > cat /compat/linux/proc/[any_file] works fine > What am I missing? You are not missing anything, this is a bug. A while ago, cat(1) was changed to use larger buffers when writing to regular files on machines with sufficient RAM, usually a multiple of MAXPHYS. On the other hand, pseudofs (the general framework for filesystems such as procfs, linprocfs and linsysfs) in src/sys/fs/pseudofs/pseudofs_vnops.c pfs_read() fails any read over MAXPHYS + 1 with EIO. This limit probably has to do with the allocation of a buffer of that size using sbuf_new(9) (and so, malloc(9)). Some sort of limit seems appropriate, but MAXPHYS seems unrelated, and if the request is too long it should perhaps just truncate it. -- Jilles Tjoelker