From owner-freebsd-current@freebsd.org Sat Nov 4 17:13:53 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 85E75E5097F for ; Sat, 4 Nov 2017 17:13:53 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-139.reflexion.net [208.70.210.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3177976267 for ; Sat, 4 Nov 2017 17:13:52 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 352 invoked from network); 4 Nov 2017 17:13:46 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 4 Nov 2017 17:13:46 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sat, 04 Nov 2017 13:13:46 -0400 (EDT) Received: (qmail 19876 invoked from network); 4 Nov 2017 17:13:46 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 4 Nov 2017 17:13:46 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 7955BEC8074; Sat, 4 Nov 2017 10:13:45 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r325320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs [breaks lld on zfs: lld uses fallocate] From: Mark Millard In-Reply-To: Date: Sat, 4 Nov 2017 10:13:44 -0700 Cc: "svn-src-head@freebsd.org" , FreeBSD Toolchain , Andriy Gapon , FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: <6140C4E2-168F-4E5D-B3C2-717ECB67C980@dsl-only.net> <134eea8e-1a2e-d77c-f7fa-01e14db7f47b@FreeBSD.org> To: Ed Maste X-Mailer: Apple Mail (2.3273) 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: Sat, 04 Nov 2017 17:13:53 -0000 On 2017-Nov-4, at 10:02 AM, Mark Millard wrote: > On 2017-Nov-4, at 4:58 AM, Ed Maste wrote: >=20 >> On 4 November 2017 at 07:41, Andriy Gapon wrote: >>> On 04/11/2017 12:32, Mark Millard wrote: >>>> if (int Err =3D ::posix_fallocate(FD, 0, Size)) { >>>> if (Err !=3D EOPNOTSUPP) >>>> return std::error_code(Err, std::generic_category()); >>>> } >>>=20 >>> The commit message that you didn't include into your reply contains = some useful >>> information that authors / maintainers of this code should probably = take into >>> account: >>>=20 >>>> Please note that EINVAL is used to report that the underlying file = system >>>> does not support the operation (POSIX.1-2008). >>>=20 >>> Here is a link for that: >>> = http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.= html >>=20 >> I have no idea how they decided EINVAL was a reasonable errno for = this case. >>=20 >> Mark, can you give this patch a try: >>=20 >> diff --git a/contrib/llvm/lib/Support/Unix/Path.inc >> b/contrib/llvm/lib/Support/Unix/Path.inc >> index 45097eb918b7..67edb46f0025 100644 >> --- a/contrib/llvm/lib/Support/Unix/Path.inc >> +++ b/contrib/llvm/lib/Support/Unix/Path.inc >> @@ -427,7 +427,7 @@ std::error_code resize_file(int FD, uint64_t = Size) { >> // If we have posix_fallocate use it. Unlike ftruncate it always = allocates >> // space, so we get an error if the disk is full. >> if (int Err =3D ::posix_fallocate(FD, 0, Size)) { >> - if (Err !=3D EOPNOTSUPP) >> + if (Err !=3D EINVAL && Err !=3D EOPNOTSUPP) >> return std::error_code(Err, std::generic_category()); >=20 > I've got a simple buildworld going but I expect that > it will end up using lld in a form that runs into > the problem. But I may luck out since I can link a > trivial main to produce an a.out for amd64. Actually I take that back: I no longer have WITH_LLD_IS_LD=3D as part of my normal amd64 environment. (I did for a time.) So I will not get the problem. > It may be appropriate to have notes somewhere about > what to do for folks that land in the range -r325320 > to whatever revision the updated > contrib/llvm/lib/Support/Unix/Path.inc ends up at > and that also have a zfs filesystem context involved. Explicitly adding to that context-requirement for having the problem for amd64: and that one has WITH_LLD_IS_LD=3D in use. Of course, for arm64.aarch64 WITH_LLD_IS_LD=3D is the normal case and so would be more likely to catch folks. So this too should be explicit. > I'll let you know if the build completes vs. not. It > takes a while since llvm materials are rebuilding. It should complete since binutils's ld is in use: I'm not building on aarch64 and reverted to normal for amd64 some time ago relateive to WITH_LLD_IS_LD=3D . =3D=3D=3D Mark Millard markmi at dsl-only.net