From owner-freebsd-fs@FreeBSD.ORG Thu Feb 3 23:33:28 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71ADF106566C for ; Thu, 3 Feb 2011 23:33:28 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id F28D68FC0C for ; Thu, 3 Feb 2011 23:33:27 +0000 (UTC) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p13L9Dst026795 for ; Fri, 4 Feb 2011 08:09:13 +1100 Received: from server.vk2pj.dyndns.org (c220-239-52-50.belrs4.nsw.optusnet.com.au [220.239.52.50]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p13L99wJ027279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Feb 2011 08:09:10 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p13L99AJ043955; Fri, 4 Feb 2011 08:09:09 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p13L99rf043954; Fri, 4 Feb 2011 08:09:09 +1100 (EST) (envelope-from peter) Date: Fri, 4 Feb 2011 08:09:09 +1100 From: Peter Jeremy To: Jeremy Chadwick Message-ID: <20110203210909.GA28604@server.vk2pj.dyndns.org> References: <4D47B954.3010600@FreeBSD.org> <201102021704.04274.jhb@freebsd.org> <20110202222023.GA45401@icarus.home.lan> <201102030753.55820.jhb@freebsd.org> <20110203140142.GH78089@deviant.kiev.zoral.com.ua> <20110203151318.GA9986@icarus.home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <20110203151318.GA9986@icarus.home.lan> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@freebsd.org Subject: Re: ext2fs crash in -current (r218056) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2011 23:33:28 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Feb-03 07:13:18 -0800, Jeremy Chadwick w= rote: >The offset and the length are both explicitly casted and printed as >signed numbers here. > >For me anyway, the next question is "what are bio_offset and bio_length >defined as?" (indirectly, "why the explicit cast?"). They're both >declared as part of struct bio in src/sys/sys/bio.h as shown: > > 71 struct bio { >... > 78 off_t bio_offset; /* Offset into file. */ >... > 92 off_t bio_length; /* Like bio_bcount */ >... off_t is always a 64-bit signed int and there's no printf(9) length modifier to handle this particular situation (it's typically 'long' on 64-bit archs and 'long long' on 32-bit archs). Instead it's cast to a signed int which is at least as large that does have a suitable length modifier (intmax_t can be printed using %jd). --=20 Peter Jeremy --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAk1LGXUACgkQ/opHv/APuIfMugCeO07MLbXR438w/Cadukt6L8G8 9LwAoIsx9enpFWLkEPV+hlc63xoOybS1 =ig5f -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0--