From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 95F1C1F910 for ; Mon, 7 Nov 2022 18:46:09 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="JI2pc+tH"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9410A385840D for ; Mon, 7 Nov 2022 18:46:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9410A385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667846765; bh=Gwfq4bX6m3uFahju/4vXGksVC4Jmke7L3uAZmGr7DMc=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=JI2pc+tHKEF1EhXtO1Yd1La1YwXdAAvvZmhEQSpUgIU+W2zMPhrxgtPjLnMEIgWev 3yuaNSbyQ1PAaADIi0ymHZ5ZbplNBQ/XTukYCvzFz0y1GuAdyFIWNEKd0RejxcR7kC quzkstPoXpo+KDwmWXXKcCYJmmxWhBm1BVU5tX+Q= Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by sourceware.org (Postfix) with ESMTPS id AE8033858402 for ; Mon, 7 Nov 2022 18:45:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE8033858402 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-13c569e5ff5so13708983fac.6 for ; Mon, 07 Nov 2022 10:45:44 -0800 (PST) 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 :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Gwfq4bX6m3uFahju/4vXGksVC4Jmke7L3uAZmGr7DMc=; b=GKvNkbyHASYCOV7OshXmSfulQT7OgphVWnbXKs/e7zZZy1qb5PJReAS6r6aUoz2Xp+ dR2d86PgYekJQTEw4h8h7ze+FDrzGj3O24V8UBrFo6vCTULj4tNCUg/BZE4rkz571iIl Jml2SACYiWcxTXt0Yw6//9pRGBcHC9cZR7NBEdS60/YM5iUTua7/fKYF0w3cCwgJrsSv m6nt5twQniikpHramfItoQw9CAYKf+O++Qsi4WaNfGaOoQG/1x4+dqOjeINlxojWxNf9 b+Tymy63neeKtryAzo358DUo2/GFszJKEe42y/iDEDZOvV97FXaHbGPGWU1jXipaQpuK l/Xg== X-Gm-Message-State: ACrzQf0lfwT6fG12tu9ZKNmCYjJv8Xym+Kw98oHO/Anhvudg3rRX14Ae dWeMvkMdng35yZh52QzVp+ohpA== X-Google-Smtp-Source: AMsMyM7BspyZ6MZB5rVUBJQGSULyrRPf/cNCsXRnIfYC37FXsRmO3kC8ubjI3jM7YlzNCz34s3wCmQ== X-Received: by 2002:a05:6871:1d2:b0:13d:1aee:a7e5 with SMTP id q18-20020a05687101d200b0013d1aeea7e5mr23183122oad.241.1667846743898; Mon, 07 Nov 2022 10:45:43 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c0:a9f4:fc60:ae8f:c4b6:cf0a? ([2804:1b3:a7c0:a9f4:fc60:ae8f:c4b6:cf0a]) by smtp.gmail.com with ESMTPSA id q8-20020a056870e88800b0011dca1bd2cdsm3527955oan.0.2022.11.07.10.45.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Nov 2022 10:45:43 -0800 (PST) Message-ID: <8c9f4e1a-b77b-2257-7558-41b27dbe7344@linaro.org> Date: Mon, 7 Nov 2022 15:45:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] Rename STAT_HAS_TIME32 to KERNEL_STAT64_HAS_TIME32 Content-Language: en-US To: Arnd Bergmann , YunQiang Su , Xi Ruoyao Cc: syq@debian.org, aurelien@aurel32.net, Jiaxun Yang , "Maciej W. Rozycki" References: <20221104015428.1545677-1-yunqiang.su@cipunited.com> <50e745fa-0508-43f1-bd0a-cfa789239f7e@app.fastmail.com> <6100f772-fab4-4e92-a6a9-cf882954df9d@app.fastmail.com> Organization: Linaro In-Reply-To: <6100f772-fab4-4e92-a6a9-cf882954df9d@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , From: Adhemerval Zanella Netto via Libc-alpha Reply-To: Adhemerval Zanella Netto Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 07/11/22 15:24, Arnd Bergmann wrote: > On Mon, Nov 7, 2022, at 19:08, Adhemerval Zanella Netto wrote: >> On 04/11/22 07:02, Arnd Bergmann wrote: > >> In fact it was reported as an y2106 problem some time ago [1] and we >> fixed on 2.34 [2]. And I give that STAT_HAS_TIME32 is not entirely >> clear, since for glibc perspective is has multiple stat definitions. > > I think we need to coordinate this when we change the kernel to > add truncation of the 64-bit time values. It sounds like glibc > does an 'unsigned int' to 'long long' conversion for the legacy > stat syscall, rather than a conversion from a signed value, and > it would be helpful to have a matching interpretation between > kernel and glibc. > > What is the glibc behavior for i386 with 64-bit time_t on a > kernel without statx? Does that also intepret a time value > of -1u as a 2106 timestamp, or does it convert that into a > 1969 timestamp like the other (not mips/pa-risc) 64-bit > architectures do? > > Arnd The time_t for glibc is always signed and for legacy 32-bit ABIs it issues fstatat64 and assumes that kernel will handle potential overflow by returning a proper error (if syscall succeeds then the file times are within the signed 32 bit time_t range). My understanding is mips is the only outlier here with unsigned kernel stat times, which on glibc is handled with a special function that just that interprets the values as 2106 timestamp (__cp_kstat_stat64_t64).