From owner-freebsd-toolchain@freebsd.org Sat Nov 4 11:58:52 2017 Return-Path: Delivered-To: freebsd-toolchain@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 18FDAE6C681; Sat, 4 Nov 2017 11:58:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (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 D2E116B7AC; Sat, 4 Nov 2017 11:58:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x232.google.com with SMTP id 97so11198058iok.7; Sat, 04 Nov 2017 04:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HCOyZsq6LJmLJpvVZbJ/DhxOEXPKnJ2GtRRKPBOSy3c=; b=ryj97n2ZivZUYC+SMVvHBirpgPhBHA/u2hkkM2fqufkWA2laXSW8NEs7xHvRTQnoD7 NCQhm/DroYt8xKKtIH1BNhrtESL/G7DXE76yPo+ROvP/4P7ecvgerbIB1Z4IJ8ZTyFA+ fMsrlpBlO3oLHT3GtoOTgbmyEuj0Kg5xEcUliwd+iUuf94e6NFTzjmHAE33/a6CtYfYk qNByZhQkd95kT6XMxVoWfQuxX6a/hgNGIMR+uRed2ugKFOdX+MiOwEiB1PMvbn46QOsG U97NVvVm/cxjbfbasEoSgwfW9efP4XlsWf9rGr7lhOlvr6bK+EgWYRxnU1CE/TvGwJ4m 8Lkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HCOyZsq6LJmLJpvVZbJ/DhxOEXPKnJ2GtRRKPBOSy3c=; b=pg0YjqHAs4Qcyv30vLsaIrxsgWIiIAX4X1aVK41hiBf4PQBR9o5Pdpr304ZSZv1hxa Oz00dxTa0zFNYMRFFgFmmC73Ryw1GZVEwtiYE0jSldmhlG9ijzVZkCt8o0e+HIqPImO8 Aax9lZCn4a1eiNrttSkYh3XMkaavUqSgcc5YUOaxgBdpCKlstoc9M+0LWbTC/o9cuPlj L8cNx+MpekGgKBTHE8OuHwJAYVJXqqDf+xqc9o3bVNyl3Cz8cfWE7sTTrPZAJLdvFabv KH5bwATxOmvgKja0SL3t6GPlo8ghPOu9TJLm3SBi1KARrETouEznLoUTq4CV8Yg3DCoQ n0eA== X-Gm-Message-State: AJaThX5O24xnQY1KYDx8YIFd3CVg9FjHm2upA0qr6nYuWBWxVR1JU99K SXC6q1JX2NQHexxp0dkduz8D8vmZXF2A7tf+rx6h9i2z X-Google-Smtp-Source: ABhQp+R+DWTi7soySl+3UUukG+8uJ18s5NbbhGqhg7CROMxjUhaRenK14vOWmJEJbUn/rgo2Ihdz5uYmMZVg/HgC5+8= X-Received: by 10.107.133.85 with SMTP id h82mr12737108iod.208.1509796730824; Sat, 04 Nov 2017 04:58:50 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.14.208 with HTTP; Sat, 4 Nov 2017 04:58:29 -0700 (PDT) In-Reply-To: <134eea8e-1a2e-d77c-f7fa-01e14db7f47b@FreeBSD.org> References: <6140C4E2-168F-4E5D-B3C2-717ECB67C980@dsl-only.net> <134eea8e-1a2e-d77c-f7fa-01e14db7f47b@FreeBSD.org> From: Ed Maste Date: Sat, 4 Nov 2017 07:58:29 -0400 X-Google-Sender-Auth: mdmIZtgyxGc1wT_uSuvh1jgPpbo Message-ID: Subject: Re: svn commit: r325320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs [breaks lld on zfs: lld uses fallocate] To: Andriy Gapon Cc: Mark Millard , FreeBSD Toolchain , "svn-src-head@freebsd.org" , FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Nov 2017 11:58:52 -0000 On 4 November 2017 at 07:41, Andriy Gapon wrote: > On 04/11/2017 12:32, Mark Millard wrote: >> if (int Err = ::posix_fallocate(FD, 0, Size)) { >> if (Err != EOPNOTSUPP) >> return std::error_code(Err, std::generic_category()); >> } > > 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: > >> Please note that EINVAL is used to report that the underlying file system >> does not support the operation (POSIX.1-2008). > > Here is a link for that: > http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html I have no idea how they decided EINVAL was a reasonable errno for this case. Mark, can you give this patch a try: 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 = ::posix_fallocate(FD, 0, Size)) { - if (Err != EOPNOTSUPP) + if (Err != EINVAL && Err != EOPNOTSUPP) return std::error_code(Err, std::generic_category());