From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 1 19:41:02 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 EA5AE106566B for ; Fri, 1 Jan 2010 19:41:02 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id 7EF6A8FC1B for ; Fri, 1 Jan 2010 19:41:02 +0000 (UTC) Received: by ewy26 with SMTP id 26so11263173ewy.3 for ; Fri, 01 Jan 2010 11:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BnT+n4m53QsRU/otHQNFdAUwbQx/QxkHXUhMOQ7TW2I=; b=nl1Ne7n8nafHzdaMQoFlxELOSblliI+kvBVIP30v95k66K/G6qgUiSGV9tk3PNgDBa 6Jb8cw3vEmTz6KiSk0B2P/+YxE+gjhDu4nv+fCTSZAJkWqEVGek9uu9AToGNLP9+/cTU ZMexSM5jZUKGWXOsgDRvnTO5pdVK0QUUUgGsY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=JUSscN2lu+zjNDqWQESXk6geQnbJ+llDdlsizGGw28E51MXuC2C05spyavnG415Ee6 M9Jhf6oAK3HUE8P1R0BaUVASrb8SDfcy7oBSmoDP8iyFRFoRqnN8oXaZj5erR49xi7Li jck+l+1LGhINEl50LgW3DwYdXMgqjcFISLv7A= MIME-Version: 1.0 Received: by 10.213.50.129 with SMTP id z1mr22317128ebf.33.1262374851500; Fri, 01 Jan 2010 11:40:51 -0800 (PST) In-Reply-To: <20100101193814.GA60021@stack.nl> References: <1bd550a01001010945i1a043ff9t70eb814cafe4b30a@mail.gmail.com> <20100101193814.GA60021@stack.nl> Date: Fri, 1 Jan 2010 20:40:51 +0100 Message-ID: <1bd550a01001011140y716bc636v8a9e054a35164087@mail.gmail.com> From: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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:41:03 -0000 2010/1/1 Jilles Tjoelker : > On Fri, Jan 01, 2010 at 06:45:33PM +0100, Fernando Apestegu=EDa 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. Thanks a lot for the explanation. > > -- > Jilles Tjoelker >