From owner-freebsd-current@freebsd.org Mon May 15 19:41:49 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6312AD6EF2C for ; Mon, 15 May 2017 19:41:49 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1880924B for ; Mon, 15 May 2017 19:41:49 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x22a.google.com with SMTP id c13so45283215qtc.1 for ; Mon, 15 May 2017 12:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kk6YmktLZ90EXUODxct/GBFagHVIXuQphNj950k2Y0U=; b=nJ4WfrbUvgRSsL+7lg/9V4MAh/l+X2hsY/p6rb7pPxLytDuyxjCTImO96rb9pqKz+X DcbLZrANVbLNJUdPMKeMUJ3YgDsGkL7EvHoFsPUGbzagWgNb9bPOXMhDCcZ/k8aQxJDS ZJspjBQPRmDNY4qH4JSYWnbH5PrOXBuy/Vcrz1htXRruWYCEHLpWKTc76ATpAUMIYPP1 xGTySKtwOnQ6rZk/upIShc86A71AGrRnXaMyR20aBE9FeCtrqR9c0O4R4duq/b4jIAnG oqaMxeglPagocAB+QLxkxi5DDRUXm3Hcc+co//3Xqzfsf1Sv47HE+/Pz52yS1VcPpeyY 1arA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kk6YmktLZ90EXUODxct/GBFagHVIXuQphNj950k2Y0U=; b=MblzEAmPtiTAJiNezH3Ab2IXZgDOH4vm7z36w/Wa9KmJ3LJD/o6fTkKFPhjdOYmVf1 Wk3qE4O5FXJEFGKIVTR0ZzDPbYqL412Ov3jRd5iNq+dgMdEJMxi9fJ7yt28fBa5zEBS/ 1O+ObVIjyGvOgWpXaHVYugEWjpySmMm2F76mGoQ/j18Uds2WxKSPItU5eTEmTQdxEwyA cJu+z+Wd7x1OLl7VFGLOD091v3PVdS3XFTFdDFFa5kKHJ3pV4KDZJ6QoZWX/DX9+C6KQ qQeTYHHKJXvGu6DvRIBw//1I5WK2BCqEWbZ0K4DxaNfMvKX38U1zFAul/BqqzAdLsz1p qDNA== X-Gm-Message-State: AODbwcBxAUVfJgLY8ykHkahjxS3PWIhAB+pJBz9Dfaj6+E5pxj9vqZCN Wbd4zd6azdXr0QukSGEHoA== X-Received: by 10.200.34.242 with SMTP id g47mr6901497qta.109.1494877308112; Mon, 15 May 2017 12:41:48 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id t35sm9134628qta.62.2017.05.15.12.41.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 May 2017 12:41:47 -0700 (PDT) Date: Mon, 15 May 2017 15:41:45 -0400 From: Shawn Webb To: Konstantin Belousov Cc: freebsd-current@freebsd.org, freebsd-fs@freebsd.org, freebsd-ports@freebsd.org, emaste@freebsd.org, Kirk McKusick Subject: Re: 64-bit inodes (ino64) Status Update and Call for Testing Message-ID: <20170515194145.tx2mp6gxjxbcpbng@mutt-hbsd> References: <20170420194314.GI1788@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="meq5xjd7oh4cv4tt" Content-Disposition: inline In-Reply-To: <20170420194314.GI1788@kib.kiev.ua> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170306 (1.8.0) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2017 19:41:49 -0000 --meq5xjd7oh4cv4tt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 20, 2017 at 10:43:14PM +0300, Konstantin Belousov wrote: > Inodes are data structures corresponding to objects in a file system, > such as files and directories. FreeBSD has historically used 32-bit > values to identify inodes, which limits file systems to somewhat under > 2^32 objects. Many modern file systems internally use 64-bit identifiers > and FreeBSD needs to follow suit to properly and fully support these > file systems. >=20 > The 64-bit inode project, also known as ino64, started life many years > ago as a project by Gleb Kurtsou (gleb@). After that time several > people have had a hand in updating it and addressing regressions, after > mckusick@ picked up and updated the patch, and acted as a flag-waver. >=20 > Sponsored by the FreeBSD Foundation I have spent a significant effort > on outstanding issues and integration -- fixing compat32 ABI, NFS and > ZFS, addressing ABI compat issues and investigating and fixing ports > failures. rmacklem@ provided feedback on NFS changes, emaste@ and > jhb@ provided feedback and review on the ABI transition support. pho@ > performed extensive testing and identified a number of issues that > have now been fixed. kris@ performed an initial ports investigation > followed by an exp-run by antoine@. emaste@ helped with organization > of the process. >=20 > This note explains how to perform useful testing of the ino64 branch, > beyond typical smoke tests. >=20 > 1. Overview. >=20 > The ino64 branch extends the basic system types ino_t and dev_t from > 32-bit to 64-bit, and nlink_t from 16-bit to 64-bit. The struct dirent > layout is modified due to the larger size of ino_t, and also gains a > d_off (directory offset) member. As ino64 implies an ABI change anyway > the struct statfs f_mntfromname[] and f_mntonname[] array length > MNAMELEN is increased from 88 to 1024, to allow for longer mount path > names. >=20 > ABI breakage is mitigated by providing compatibility using versioned > symbols, ingenious use of the existing padding in structures, and by > employing other tricks. Unfortunately, not everything can be fixed, > especially outside the base system. For instance, third-party APIs > which pass struct stat around are broken in backward and forward- > incompatible way. >=20 > 2. Motivation. >=20 > The main risk of the ino64 change is the uncontrolled ABI breakage. > Due to expansion of the basic types dev_t, ino_t and struct dirent, > the impact is not limited to one part of the system, but affects: > - kernel/userspace interface (syscalls ABI, mostly stat(2), kinfo > and more) > - libc interface (mostly related to the readdir(3), FTS(3)) > - collateral damage in other libraries that happens to use changed types > in the interfaces. See, for instance, libprocstat, for which compat > was provided using symbol versioning, and libutil, which shlib version > was bumped. >=20 > 3. Quirks. >=20 > We handled kinfo sysctl MIBs, but other MIBs which report structures > depended on the changed type, are not handled in general. It was > considered that the breakage is either in the management interfaces, > where we usually allow ABI slip, or is not important. >=20 > Struct xvnode changed layout, no compat shims are provided. >=20 > For struct xtty, dev_t tty device member was reduced to uint32_t. It > was decided that keeping ABI compat in this case is more useful than > reporting 64bit dev_t, for the sake of pstat. >=20 > 4. Testing procedure. >=20 > The ino64 project can be tested by cloning the project branch from > GitHub or by applying the patch at URL | attached> to a working tree. The authorative source is the > GitHub, I do not promise to update the review for each update. >=20 > To clone from GitHub: > % git clone -b ino64 https://github.com/FreeBSDFoundation/freebsd.git ino= 64 >=20 > To fetch the patch from Phabricator: > - Visit https://reviews.freebsd.org/D10439 > - Click "Download Raw Diff" at the upper right of the page >=20 > Or > % arc patch D10439 >=20 > After that, in the checkout directory do > % (cd sys/kern && touch syscalls.master && make sysent) > % (cd sys/compat/freebsd32 && touch syscalls.master && make sysent) > If you use custom kernel configuration, ensure that > options COMPAT_FREEBSD11 > is included into the config. Then build world and kernel in the > usual way, install kernel, reboot, install new world. Do not make > shortcuts in the update procedure. Hey Kostik, On my HardenedBSD system, world compiled fine with the patch, but the kernel didn't compile. I've uploaded the log to: https://hardenedbsd.org/~shawn/2017-05-15_ino64-r01.log This was from importing the patch from Phabricator into hardened/current/master in HardenedBSD. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --meq5xjd7oh4cv4tt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlkaBHYACgkQaoRlj1JF bu7DVQ//dkA0Nm4bCMZ0B4Iv3TwZAoWP+EyzLwUAW3ywzM3KhMJyLuGnOIcb+UZ3 szb7jAQEbnOQN3IYsKxKIGmMr0/XFJsdeTGPo29yQ5WFfEpQPZRVkWtC162YrFiE fH9Xuizw3puetGAxlzE3JNM6rBmlJUq0GB1FhUoKlMYD22p6/HTQ3Rn+tJp8oR5R xr0v3F18JcyIbean0RhzXwQZtdTcHpuCL1kgdz+RdrVspY8cw48baJhzburX6ITg XnaU1JSTwWYE58HBfWd6/S5g2/nW9xYfQMNHjuq7vOLPVpy3PWIwelYtcfKMULtt KF/tIsWqPEbPmHhh2BbtzKW95oRruY0M9V8y04cSGFGRaGixXSBJCQ4yQTS0yegy zBpEgY/zZ21MQCrzPIdp7CzfRqWrpIjVS94gska5uER9xI3bq28nWnGwPjeoca4D 5SmNMM6TMWBU2occWwFkaXIURXY+sBxLDbPlBcLGEMkkfm/BajUOrk8YJydCMZeq 73s4b7dKQKWS5Aa18V6Y9/rWMbSQqx/FD7Dvc8rqc49jwv9nRKO6AteEGMvBvKUs NHj1PdeExdtMnuSZd3CFDdTfU0RRy0gqqfISw9ns5aPz0Ofdo9xAjGSEpUGF2Tpu LyX+6X/DlSApPZyC8QsSItKBicuOScXHIQs8AYxX3q7TF8wAbXE= =gxsk -----END PGP SIGNATURE----- --meq5xjd7oh4cv4tt--