From owner-svn-src-head@freebsd.org Mon Nov 6 23:40:14 2017 Return-Path: Delivered-To: svn-src-head@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 BDB10E69C2E; Mon, 6 Nov 2017 23:40:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 990A3650CA; Mon, 6 Nov 2017 23:40:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id D46F810A87D; Mon, 6 Nov 2017 18:40:06 -0500 (EST) From: John Baldwin To: Ngie Cooper Cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Mon, 06 Nov 2017 14:52:18 -0800 Message-ID: <188800397.5yAOiIDbtG@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <5199F871-5DE2-4434-87F2-FEF88DB34037@gmail.com> References: <201711021349.vA2Dn8Yg063559@repo.freebsd.org> <5199F871-5DE2-4434-87F2-FEF88DB34037@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 06 Nov 2017 18:40:06 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 23:40:14 -0000 On Thursday, November 02, 2017 10:38:49 AM Ngie Cooper wrote: >=20 > > On Nov 2, 2017, at 06:49, Andriy Gapon wrote: > >=20 > > Author: avg > > Date: Thu Nov 2 13:49:08 2017 > > New Revision: 325320 > > URL: https://svnweb.freebsd.org/changeset/base/325320 > >=20 > > Log: > > Disable posix_fallocate(2) for ZFS > >=20 > > The generic (naive) implementation of posix_fallocate cannot provi= de the > > standard mandated guarantee that overwrites would never fail due t= o the lack > > of free space. The fundamental reason is the copy-on-write archit= ecture > > of ZFS. Other features like compression and deduplication can als= o > > increase the size difference between the (pre-)allocated dummy con= tent > > and the future content. > >=20 > > So, until ZFS can properly implement the feature it's better to re= port > > that it is unsupported rather than providing an ersatz implementat= ion. > > Please note that EINVAL is used to report that the underlying file= system > > does not support the operation (POSIX.1-2008). > >=20 > > illumos and ZoL seem to do the same. > >=20 > > MFC after: 3 weeks > > Sponsored by: Panzura >=20 > It=E2=80=99d be nice if it worked though and was reported via the fil= e system. Posix suggests it should be, as of 2013: http://austingroupb= ugs.net/view.php?id=3D687 . >=20 > Need to go poking around and see what=E2=80=99s in freebsd later on t= onight. Bug filed: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D= 223383 . The austingroup link is just about adding a new pathconf() variable. posix_fallocate() would seem to be fundamentally incompatible with COW filesystems and can never work reliably for those. Even if you reserve= d N free blocks somehow until the first write, that doesn't allow multiple writes to the same file blocks while avoiding block allocation. falloc= ate only makes sense for overwriting filesystems like UFS. --=20 John Baldwin