From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-13c569e5ff5so13708983fac.6 for ; Mon, 07 Nov 2022 10:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=Gwfq4bX6m3uFahju/4vXGksVC4Jmke7L3uAZmGr7DMc=; b=EY8uRZriRRt4igQ550NOTBxEmKRy+FH0iBqjcu7L50szVq7cTjWd3qkH9hjBBifnj5 nOc9k2VHzADVMa102T0xQs9opkxKGCFM/rznE9B653aceNEdct/f+Nz7HlxwDv3zhZaC HLi7TBDC70PkgOsmPUvepzQOcu/xhzHhk+yuCrclMA5NGsfwxVsqt64yBQzhEdnnkVPL D3TlHkbD321yfRQzrmt2VC769sIWt/kr/a+4OevfuR0YazE5AmGap+etKY2rKun49zAe u54V6Sg/SOVfwXa7MpYc2h8OhA54RQ99nqa2uv1TFHCNl506ZVIwXQLBFiTOuWTHybcK xCVQ== 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> From: Adhemerval Zanella Netto 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-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 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).