Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2B91C4338F for ; Mon, 9 Aug 2021 10:28:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 121696108F for ; Mon, 9 Aug 2021 10:28:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 121696108F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:49434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mD2WF-0001SX-LD for qemu-devel@archiver.kernel.org; Mon, 09 Aug 2021 06:28:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD2Vc-0000ec-5Q for qemu-devel@nongnu.org; Mon, 09 Aug 2021 06:27:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD2VZ-00053O-6B for qemu-devel@nongnu.org; Mon, 09 Aug 2021 06:27:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628504867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GbUf33Fr4burprdMzIEnpgvBePBbkS8xXldrpZwkgj8=; b=NGfA/lpCxKDx/gVeAwQVF4t8x9T5q4YMxsy0cAFfqHQ3LHn7cZrk0SUbxU82FRW6cMxb08 uEoQFf6koide9PieNNTnFMB8R/S0v82KqsTec9nMttYuJMvo8oLBqu8mYbRq44cizxTiNd 6gtMhPJsuDcecRvjfiZ5c2Buc90QvGQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-595-8E1ZkveVMUqQEft12uTgvw-1; Mon, 09 Aug 2021 06:27:46 -0400 X-MC-Unique: 8E1ZkveVMUqQEft12uTgvw-1 Received: by mail-wm1-f70.google.com with SMTP id y6-20020a1c7d060000b02902e6946a8d1fso631730wmc.9 for ; Mon, 09 Aug 2021 03:27:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GbUf33Fr4burprdMzIEnpgvBePBbkS8xXldrpZwkgj8=; b=pUoZgFk0MH1OKyKa5DyG1fPgV/WA7CdhE7DAfgU9Ye+6SYqCmCtJYiRq234/GTTlyE SmUu/QI4uvCTdOVVKpiWEtU7cJVGveS9Q+9vJGKuumjmwkaPcn3BORolwOAxCR2WpfY3 6Xsdq7L+ZXwsIkO8JOGzk7D88EAVUiM7jM8mOhpewMD/C7PHUm+DsmsZSqRbQl2vaspv JQyxCfSso5gHUqw3sALg9mrz6y4Cz8+5QBa9mB7za8RmZHSZ2hAFF6zBJ+bCsc3EYlyN eOX8hS7aW9D0zaXYor+96ZR/Cy8yrT2nW47VqvFesFU6SRQvTLH2B+M4b/lW58qhdUau o0dg== X-Gm-Message-State: AOAM532oR8KZNyumfOyCBzoMUicjExYjt7+kH/bbVWi8irEdCb36Rk5J qHwUzK153trVYBzbxIN3Re1GCME7dQ58h1X0UGILutOED/B6NLHQJyUxXN/TjT+MR4MknmERnXH IYh12QePuzN+XJcA= X-Received: by 2002:adf:f4d2:: with SMTP id h18mr11686407wrp.37.1628504864927; Mon, 09 Aug 2021 03:27:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGfDaWU3YqRtVyyRV2qZPWXdTWVGESsM0i561CYXODYfOhhc4adRH8tRxDurjXVqwavNc9Hg== X-Received: by 2002:adf:f4d2:: with SMTP id h18mr11686390wrp.37.1628504864709; Mon, 09 Aug 2021 03:27:44 -0700 (PDT) Received: from [192.168.1.36] (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id h16sm19323224wre.52.2021.08.09.03.27.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 03:27:44 -0700 (PDT) Subject: Re: [PATCH-for-6.1 v2] block/export/fuse.c: fix musl build To: Fabrice Fontaine , qemu-devel@nongnu.org References: <20210809095101.1101336-1-fontaine.fabrice@gmail.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <89081202-f46d-7345-1ddd-0c2f9418483d@redhat.com> Date: Mon, 9 Aug 2021 12:27:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210809095101.1101336-1-fontaine.fabrice@gmail.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.707, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Denis V. Lunev" , Qemu-block , Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 8/9/21 11:51 AM, Fabrice Fontaine wrote: > Fix the following build failure on musl raised since version 6.0.0 and > https://gitlab.com/qemu-project/qemu/-/commit/4ca37a96a75aafe7a37ba51ab1912b09b7190a6b > because musl does not define FALLOC_FL_ZERO_RANGE: > > ../block/export/fuse.c: In function 'fuse_fallocate': > ../block/export/fuse.c:563:23: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function) > 563 | } else if (mode & FALLOC_FL_ZERO_RANGE) { > | ^~~~~~~~~~~~~~~~~~~~ > > Fixes: > - http://autobuild.buildroot.org/results/b96e3d364fd1f8bbfb18904a742e73327d308f64 > > Signed-off-by: Fabrice Fontaine > --- > Changes v1 -> v2 (after review of Philippe Mathieu-Daudé): > - Use CONFIG_FALLOCATE_ZERO_RANGE and make safer #ifdef'ry > > block/export/fuse.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/block/export/fuse.c b/block/export/fuse.c > index ada9e263eb..fc7b07d2b5 100644 > --- a/block/export/fuse.c > +++ b/block/export/fuse.c > @@ -635,7 +635,9 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode, > offset += size; > length -= size; > } while (ret == 0 && length > 0); > - } else if (mode & FALLOC_FL_ZERO_RANGE) { > + } > +#ifdef CONFIG_FALLOCATE_ZERO_RANGE > + else if (mode & FALLOC_FL_ZERO_RANGE) { > if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + length > blk_len) { > /* No need for zeroes, we are going to write them ourselves */ > ret = fuse_do_truncate(exp, offset + length, false, > @@ -654,7 +656,9 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode, > offset += size; > length -= size; > } while (ret == 0 && length > 0); > - } else if (!mode) { > + } > +#endif /* CONFIG_FALLOCATE_ZERO_RANGE */ > + else if (!mode) { > /* We can only fallocate at the EOF with a truncate */ > if (offset < blk_len) { > fuse_reply_err(req, EOPNOTSUPP); > Reviewed-by: Philippe Mathieu-Daudé