From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 19 13:49:27 2007 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BE4716A41B; Wed, 19 Sep 2007 13:49:27 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from mail.ipt.ru (mail.ipt.ru [194.62.233.102]) by mx1.freebsd.org (Postfix) with ESMTP id 3719813C45B; Wed, 19 Sep 2007 13:49:27 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from doc.sem.ipt.ru ([192.168.12.1] helo=ipt.ru) by mail.ipt.ru with esmtp (Exim 4.62 (FreeBSD)) (envelope-from ) id 1IXzvh-0000Ho-V1; Wed, 19 Sep 2007 17:49:26 +0400 Received: from bsam by ipt.ru with local (Exim 4.63 (FreeBSD)) (envelope-from ) id 1IXzxD-000Cth-C9; Wed, 19 Sep 2007 17:50:59 +0400 To: Roman Divacky References: <46EF7E05.5040405@gmail.com> <20070918074332.GA30053@freebsd.org> <88000019@srv.sem.ipt.ru> <20070918082119.GA30932@freebsd.org> <89768331@srv.sem.ipt.ru> <41596338@srv.sem.ipt.ru> <20070919085405.GA24442@freebsd.org> <18395962@srv.sem.ipt.ru> <20070919111557.GA28377@freebsd.org> <75502368@srv.sem.ipt.ru> <20070919132546.GA35553@freebsd.org> From: Boris Samorodov Date: Wed, 19 Sep 2007 17:50:59 +0400 In-Reply-To: <20070919132546.GA35553@freebsd.org> (Roman Divacky's message of "Wed\, 19 Sep 2007 15\:25\:46 +0200") Message-ID: <09429788@srv.sem.ipt.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.99 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org, sam Subject: Re: linuxolator problem on i386 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2007 13:49:27 -0000 On Wed, 19 Sep 2007 15:25:46 +0200 Roman Divacky wrote: > > > @@ -442,8 +443,7 @@ > > > > > off = fp->f_offset; > > > > > - buflen = max(LINUX_DIRBLKSIZ, nbytes); > > > - buflen = min(buflen, MAXBSIZE); [1] > > > + buflen = max(buflen, MAXBSIZE); > > > buf = malloc(buflen, M_TEMP, M_WAITOK); > > > vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); > > > > No. It limits buflen to which is smaller, buflen or MAXBSIZE. > I wonder why the limitation is there.. Seems that there is something that should keep this value not less than LINUX_DIRBLKSIZ (or 512 bytes for now). > can you try > buflen = min(nbytes, MAXBSIZE); Actually, I don't see a reason. The code is clean to mee... nbytes is always 4096 here and so do buflen (I did some printf's). > and/or > changing > while (len > 0) { > to > while (len >= 0)4 { ? WBR -- Boris Samorodov (bsam) Research Engineer, http://www.ipt.ru Telephone & Internet SP FreeBSD committer, http://www.FreeBSD.org The Power To Serve