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 D470C3858D35 for ; Wed, 2 Nov 2022 14:37:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D470C3858D35 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-13bd19c3b68so20502093fac.7 for ; Wed, 02 Nov 2022 07:37:40 -0700 (PDT) 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=/tjy1X8TSnyxRx2KePHDhMbR3I7gJgGhlgmfDGSPaNo=; b=bITFoaOn2pM/r3VvV+UBcTvXD0QIQt+zyTWAzUHj4R31vjuqMs6Kh/sxlVQLd9pMF8 9VFnNAxhEbYZjv1htc36EdLlKPt1Eq8nun+VMO/jwGtLAZkcsy3jZrwLbcEVE6jVPI1I TBxlFhQl9O7x9jcVnHnXomLzMQkxfu3T7Wg2sd58JyphzqBclraMpeYk3DlLu/yOdAue T7XZeAyy4zXiaCr9LfQradH63hdq/o8JrLsuNrcVd5AwOOFjTdsXHa6Pqsq6Jq/xmx90 7DXoy9p0YmobZyV+w35aHACPvKMuhr5QiQzZ2JJYpCa4JjBlMG8Nhe5OXKjST8TSmgN7 uKQg== 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=/tjy1X8TSnyxRx2KePHDhMbR3I7gJgGhlgmfDGSPaNo=; b=HhPvNH6Fus6oCaK1KCE3+uWBFCoLN1eU8ywlsdwRPJh06UxIYenIlPfEcWUlPmOfjv 2zeSfKlfBQETBW0wCwDKYrkT8Eqbf2UZUN+sWBgM8+BoSxk582Ca+cXPj0rRI55sgUr3 yuq5pcQ2/+Ikdp8qcVtFU8kR1Bjeh+yQAwKjVDzwi9NbS+XszHRK+AdMqvv2G1exMTWa H1OGAwzbkLK5N/YljN3YSt/U2SzQAFm6qYD/mJGamu2eMXfPhZBzcWwLgpO0fIf2pggK y08UJebECnNRBkx3YJu5o1qQQvauJQwvbc/pnkQTIQEGSBC95spTnrszYVkW017+Iqco 6mTA== X-Gm-Message-State: ACrzQf11IZstLM62FF/r0C/4efKgoixMGE+DtQwQI1p+M6bjyNA3yBG3 AAnbwOacPHhqwUEDB/6fpsQpoA== X-Google-Smtp-Source: AMsMyM6RzPMzsQeHucw0BFsdLILc7YqDQ/sW65MsKohZpwUZa8sDMWczn8hOYHHmqDpowMbSMqQOPQ== X-Received: by 2002:a05:6870:608e:b0:12b:c0de:bc9d with SMTP id t14-20020a056870608e00b0012bc0debc9dmr15393932oae.52.1667399858908; Wed, 02 Nov 2022 07:37:38 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:a9f4:4093:e060:2c0e:46f6? ([2804:1b3:a7c0:a9f4:4093:e060:2c0e:46f6]) by smtp.gmail.com with ESMTPSA id l19-20020a05687040d300b00127ebb410a4sm6111737oal.11.2022.11.02.07.37.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Nov 2022 07:37:38 -0700 (PDT) Message-ID: <6a4fd051-0a34-d4a0-0346-a2c4407cbd42@linaro.org> Date: Wed, 2 Nov 2022 11:37:35 -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] linux: Fix fstatat on MIPSn64 (BZ #29730) Content-Language: en-US To: Aurelien Jarno , libc-alpha@sourceware.org Cc: YunQiang Su References: <20221101212948.22222-1-aurelien@aurel32.net> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20221101212948.22222-1-aurelien@aurel32.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 01/11/22 18:29, Aurelien Jarno wrote: > Commit 6e8a0aac2f883 ("time: Fix overflow itimer tests on 32-bit > systems") changed in_time_t_range to assume a 32-bit time_t. This broke > fstatat on MIPSn64 that was using it with a 64-bit time_t due to > difference between stat and stat64. This commit fix that by adding a > MIPSn64 specific version, which bypasses the EOVERFLOW tests. > > Resolves: BZ #29730 LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > .../unix/sysv/linux/mips/mips64/n64/fstatat.c | 51 +++++++++++++++++++ > 1 file changed, 51 insertions(+) > create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c > > This is similar to patch "linux: Fix fstatat with !XSTAT_IS_XSTAT64 and > __TIMESIZE=64 (BZ #29730)", but using a separate file for MIPSn64 > instead of #ifdef, as suggested by Adhemerval. > > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c > new file mode 100644 > index 0000000000..fe6c3a0dda > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fstatat.c > @@ -0,0 +1,51 @@ > +/* Get file status. Linux/MIPSn64 version. > + Copyright (C) 2022 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > + > +/* Different than other ABIs, mips64 has different layouts for non-LFS > + and LFS struct stat. */ > +int > +__fstatat (int fd, const char *file, struct stat *buf, int flag) > +{ > + struct __stat64_t64 st64; > + int r = __fstatat64_time64 (fd, file, &st64, flag); > + if (r == 0) > + { > + /* Clear internal pad and reserved fields. */ > + memset (buf, 0, sizeof (*buf)); > + > + buf->st_dev = st64.st_dev; > + buf->st_ino = st64.st_ino; > + buf->st_mode = st64.st_mode; > + buf->st_nlink = st64.st_nlink; > + buf->st_uid = st64.st_uid; > + buf->st_gid = st64.st_gid; > + buf->st_rdev = st64.st_rdev; > + buf->st_size = st64.st_size; > + buf->st_blksize = st64.st_blksize; > + buf->st_blocks = st64.st_blocks; > + buf->st_atim = st64.st_atim; > + buf->st_mtim = st64.st_mtim; > + buf->st_ctim = st64.st_ctim; > + } > + return r; > +} > + > +weak_alias (__fstatat, fstatat)