From owner-freebsd-stable@FreeBSD.ORG Tue Dec 20 18:30:36 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CB4D106566B for ; Tue, 20 Dec 2011 18:30:36 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id B32C28FC1B for ; Tue, 20 Dec 2011 18:30:35 +0000 (UTC) Received: (qmail 82904 invoked from network); 20 Dec 2011 18:03:53 -0000 Received: from 87.58.144.241 (HELO x2.osted.lan) (87.58.144.241) by relay00.pair.com with SMTP; 20 Dec 2011 18:03:53 -0000 X-pair-Authenticated: 87.58.144.241 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.4/8.14.4) with ESMTP id pBKI3qF8058620; Tue, 20 Dec 2011 19:03:52 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.4/8.14.4/Submit) id pBKI3qAm058617; Tue, 20 Dec 2011 19:03:52 +0100 (CET) (envelope-from pho) Date: Tue, 20 Dec 2011 19:03:52 +0100 From: Peter Holm To: Kostik Belousov Message-ID: <20111220180352.GA58342@x2.osted.lan> References: <4EECFD6A.2030905@xs4all.nl> <2E07A04E-0FBF-47BE-96E7-F615FE78056E@gromit.dlib.vt.edu> <4EEFAC55.6050507@xs4all.nl> <20111219225143.GD2391@server.vk2pj.dyndns.org> <20111220094832.GL50300@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111220094832.GL50300@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i Cc: Michiel Boland , freebsd-stable@freebsd.org, Peter Jeremy Subject: Re: fsck_ufs out of swapspace X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2011 18:30:36 -0000 On Tue, Dec 20, 2011 at 11:48:33AM +0200, Kostik Belousov wrote: > On Tue, Dec 20, 2011 at 09:51:43AM +1100, Peter Jeremy wrote: > > On 2011-Dec-19 22:27:49 +0100, Michiel Boland wrote: > > >Problem solved - it was indeed an endian thing. > > >The problem is that fsck uses a real_dev_bsize variable that is declared long, > > >but the DIOCGSECTORSIZE ioctl takes an u_int argument. > > > > To be accurate, this isn't an endian problem, it's a general problem > > of passing a pointer to an incorrectly sized object. The bug is > > masked on amd64 & iA64 because real_dev_bsize is statically allocated > > and therefore initialised to zero. This means the failure to assign > > the top 32 bits in the ioctl doesn't affect the final result. > > > > >A PR has been submitted. > > > > sparc64/163460 for the record. Thank you for tracking that down. > > The easier fix is to change the type of real_dev_bsize. I used long only > because other n variables keeping the sector size are long, but there > is no much reason to use long there. > > Peter, would you, please retest the +J on non-512 byte sectors, with the > patch attached ? > No problems seen while testing on both i386 and amd64 with a malloc MD disk, sector size of 4k and SUJ. - Peter