From owner-freebsd-current@freebsd.org Mon Nov 6 15:40:30 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 79389E611AD; Mon, 6 Nov 2017 15:40:30 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) (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 0CFD6741DF; Mon, 6 Nov 2017 15:40:29 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f53.google.com with SMTP id r129so10965674lff.8; Mon, 06 Nov 2017 07:40:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=/CUqSXAa+7aJvdHtKH5SZWVVRFEvEs2nTuXSqHNz5ao=; b=Irdss4zKp0CgtVpOr21ARL2TyPt5W9Y8097bShn/R6gIq7/Ctp/g8Bhm8z68U1o+fw ujURv0zxNREP3RUBIFivwbyMmIdZC5PbSu2x+ApX+Ndf/zVi9hdvPGvFEs6a+bLmGpP4 NCC1otuuTXn5O6b1O0wZES2h08g/cAP79B7f1jMbBXl2G52CKiUt+cuQCK7w2Q56DVcg QIDsiIKCkLnWSDRWjDxsXJ9y8/CbYs/Rt7so7XxWmvafqQN66Yt/tnOKOeWG0/NvxLH4 6PuueK3xQnKJXfJncCLicl7nFhQ49hS7iIAv5qup4P7GkQxsYW7ZwrNbn3i2snXIqA1c BT7w== X-Gm-Message-State: AMCzsaW37dob1IkBDr30sF6O7VKR+MtxRoYJu65Pwa/WXRljUCKznq31 9e0SQlrM8QzxmlooUUIYJLFoYDK12Os= X-Google-Smtp-Source: ABhQp+RHfyOpv0eibAP90keibe6xWz7oUgUqwglSQeIH9HXbmtN5h58zD4iEJWPMvQqeQS6j5fgS0g== X-Received: by 10.46.4.29 with SMTP id 29mr7032020lje.82.1509982822311; Mon, 06 Nov 2017 07:40:22 -0800 (PST) Received: from [192.168.0.197] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id z66sm2702207ljb.75.2017.11.06.07.40.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 07:40:21 -0800 (PST) To: freebsd-current@FreeBSD.org, freebsd-fs@FreeBSD.org From: Andriy Gapon Subject: [HEADS UP] posix_fallocate support removed from ZFS, lld affected Message-ID: <7e5599e4-2faa-29b6-4fb2-a0744a12681a@FreeBSD.org> Date: Mon, 6 Nov 2017 17:40:19 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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, 06 Nov 2017 15:40:30 -0000 >From UPDATING: The naive and non-compliant support of posix_fallocate(2) in ZFS has been removed as of r325320. The system call now returns EINVAL when used on a ZFS file. Although the new behavior complies with the standard, some consumers are not prepared to cope with it. One known victim is lld prior to r325420. >From https://svnweb.freebsd.org/changeset/base/325320 The generic (naive) implementation of posix_fallocate cannot provide the standard mandated guarantee that overwrites would never fail due to the lack of free space. The fundamental reason is the copy-on-write architecture of ZFS. Other features like compression and deduplication can also increase the size difference between the (pre-)allocated dummy content and the future content. So, until ZFS can properly implement the feature it's better to report that it is unsupported rather than providing an ersatz implementation. Please note that EINVAL is used to report that the underlying file system does not support the operation (POSIX.1-2008). illumos and ZoL seem to do the same. lld is affected by the change. That means that any world builds where lld is used are affected as well (if ZFS is involved, of course). One example is the arm64 build (typically a cross build from amd64). The lld issue is fixed in head as of r325420. But other branches are still affected (if you are building them on a head kernel). Other posix_fallocate consumers could be affected too. -- Andriy Gapon