From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by sourceware.org (Postfix) with ESMTPS id 60F653858C52 for ; Fri, 12 Aug 2022 12:45:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60F653858C52 Received: by mail-vs1-xe36.google.com with SMTP id q15so707260vsr.0 for ; Fri, 12 Aug 2022 05:45:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=uztr/zlD91sOVn40ZSwhkGm/EIoSGW6MuGvXLRLEk88=; b=yrJ/VGWLEjXLiXGrwsvmsqgzIFRMrVxvPflMbf/V0mjml09fqXESb0DsU/09Z377Wi sUW3+YJ4V1p1a7ou4n66ff/TGZ84VMmsYijEfa2EBbhd9hQurwHDRKaibMy4p1njkuuy uPc4k9+E0EfDgbLB/s7uctfSHRmM/ZDQtPFYoNcmzhxJXtlcjyNO53SowCg7S8EOCZXL vmc7HRTXb0Q4DQQ6723D+iWUvs+0hMxi9N/7Uc474nKKRYQ78YOy4VN0zKd8WuzYN0h6 6A7Ot3r/fKJmj8GpC9jxpnwA4Ae5VNv0/GCEHjbXqOEOt3v6NcDfHHFKX6OJfLZe2gk3 MC7g== X-Gm-Message-State: ACgBeo2qaP0ujJWfLf5e9biAnB3JTcwGAfmuwC0v9mQsROYBxW8q/H8I /wGu1uHRQ7RYsMkWYtYu26YfZg== X-Google-Smtp-Source: AA6agR4VF6b1In7DWuFIgPR3Bb0JteZiYZAJYvXRb6E+1Mcx9pt93XQnR+zdcfntorOuDgssLNESdw== X-Received: by 2002:a67:e243:0:b0:387:3666:4e67 with SMTP id w3-20020a67e243000000b0038736664e67mr1530107vse.47.1660308343608; Fri, 12 Aug 2022 05:45:43 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:89b:9d50:8d25:b9e5:dcfc? ([2804:1b3:a7c0:89b:9d50:8d25:b9e5:dcfc]) by smtp.gmail.com with ESMTPSA id v74-20020a1f2f4d000000b0037d0bb0a3c8sm1386473vkv.15.2022.08.12.05.45.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Aug 2022 05:45:43 -0700 (PDT) Message-ID: <8d04752f-7df5-376d-4287-00124cbe921b@linaro.org> Date: Fri, 12 Aug 2022 09:45:39 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH v2 5/5] linux: Fix sys/mount.h usage with kernel headers Content-Language: en-US To: Florian Weimer , Adhemerval Zanella via Libc-alpha References: <20220810172447.1502169-1-adhemerval.zanella@linaro.org> <20220810172447.1502169-6-adhemerval.zanella@linaro.org> <874jyisasf.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <874jyisasf.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2022 12:45:46 -0000 On 11/08/22 18:57, Florian Weimer wrote: > * Adhemerval Zanella via Libc-alpha: > >> Now that kernel exports linux/mount.h and includes it on linux/fs.h, >> its definitions might clash with glibc exports sys/mount.h. To avoid >> the need to rearrange the Linux header to be always after glibc one, >> the glibc sys/mount.h is changed to: >> >> 1. Undefine the macros also used as enum constants. This covers prior >> inclusion of (for instance MS_RDONLY). >> >> 2. Include based on the usual __has_include check >> (needs to use __has_include ("linux/mount.h") to paper over GCC >> bugs. >> >> 3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined. >> (FSOPEN_CLOEXEC should be a very close proxy.) >> >> 4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined. >> (Added in the same commit on the Linux side.) >> >> This patch also adds some tests to check if including linux/fs.h and >> linux/mount.h after and before sys/mount.h does work. >> >> Checked on x86_64-linux-gnu. > > Also built with build-many-glibcs.py. This version looks good. > > There is a gap with old compilers only (those that don't have > __has_include), and if is included after , > but I think that's an acceptable trade-off. At least gcc 6 does have support for __has_include (or it was backported in the release branches) which the minimum supported version to build glibc itself. I am not sure how common is deployment with gcc version older with newer glibc, so I agree with the trade-off. > > Reviewed-by: Florian Weimer > Thanks. > Thanks, > Florian >