From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hall.aurel32.net (hall.aurel32.net [IPv6:2001:bc8:30d7:100::1]) by sourceware.org (Postfix) with ESMTPS id 3BCEE3858C53 for ; Tue, 29 Aug 2023 16:30:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3BCEE3858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=aurel32.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=aurel32.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Content-Transfer-Encoding:From:Reply-To: Subject:Content-ID:Content-Description:X-Debbugs-Cc; bh=AdhQ+S309xNQkuQm/S+N+aUXqTctXYdAiOh1D8AVqwc=; b=rsAax9ZyV4a0GhlxzHrMYAfWwP fCXjny2IlTHNfaI5FGBnc5C2m8cW1CYk+uWAG1KYg6fV+/ZO5dyntdz+KyO4ngoA/GF8VPWnTCUIK G9dgUltB1TMrj1yIjAhqDqeIK7hjQpC9/ekAjG8Pqwp1V9/I5wu7xlJyAfL/JYnulFSZNFlFF1q5x fxkFvYiEhWoXqIhSHdQz1scGnD9G52eA57JM+nsmuyYOtgGF+EpKoXXvneXkXpwz87vBJClkHakua RTPcqDXKrPzvi2l9/0jdqP//EDESkUcG7FNMdwuLX7tJnSa2U+f/mJ6EkiRiNv37D82LUiX68q7x3 AMM8VecQ==; Received: from [2a01:e34:ec5d:a741:9a7b:5831:531:65c9] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qb1be-00EnXA-96; Tue, 29 Aug 2023 18:30:18 +0200 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.96) (envelope-from ) id 1qb1bd-00CuVg-1u; Tue, 29 Aug 2023 18:30:17 +0200 Date: Tue, 29 Aug 2023 18:30:17 +0200 From: Aurelien Jarno To: Adhemerval Zanella Netto Cc: Florian Weimer , libc-alpha@sourceware.org Subject: Re: [PATCH] io: Fix record locking contants for powerpc64 with __USE_FILE_OFFSET64 Message-ID: Mail-Followup-To: Adhemerval Zanella Netto , Florian Weimer , libc-alpha@sourceware.org References: <20230828213721.2957677-1-aurelien@aurel32.net> <87pm36nut5.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.9 (2022-11-12) X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-08-29 10:20, Adhemerval Zanella Netto wrote: > > > On 29/08/23 04:59, Florian Weimer via Libc-alpha wrote: > > * Aurelien Jarno: > > > >> diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h > >> index f7615a447e..d8a291a331 100644 > >> --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h > >> +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h > >> @@ -33,7 +33,7 @@ > >> # define __O_LARGEFILE 0200000 > >> #endif > >> > >> -#if __WORDSIZE == 64 > >> +#if __WORDSIZE == 64 && !defined __USE_FILE_OFFSET64 > >> # define F_GETLK 5 > >> # define F_SETLK 6 > >> # define F_SETLKW 7 > > > > I find this puzzling. Why would __USE_FILE_OFFSET64 have an effect if > > __WORDSIZE is 64? > > This is a historical artifact from powerpc64. Instead of following other 64-bit > architectures and define F_GETLK the same whether _FILE_OFFSET_BITS is defined, > the port used powerpc definitiosn that required different values to support LFS. > > This patch is not wrong, but at same time not really required. The powercp64 > fcntl will handle F_GETLK/F_SETLK/F_SETLKW with the historical values with > the FCNTL_ADJUST_CMD macro, so old binaries will continue to work as expected. It does break some binaries, for instance File-FcntlLock [1] with the following scenario: - perl is built against glibc 2.37 - system is upgraded to glibc 2.38 - File-FcntlLock is built against glibc 2.38: it does not work as the value of F_GETLK has changed from 12 to 5 [2]. In short these constants are not exclusively used by the glibc. They might be referenced in some libraries, and changing their values break things. [1] https://metacpan.org/dist/File-FcntlLock [2] https://metacpan.org/release/JTT/File-FcntlLock-0.22/source/FcntlLock.xs#L74 -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://aurel32.net