From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id D39FE3850407 for ; Tue, 16 Mar 2021 14:24:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D39FE3850407 Received: by mail-qt1-x836.google.com with SMTP id u7so11724740qtq.12 for ; Tue, 16 Mar 2021 07:24:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bXtJGC+aXmtshV/XPSBKKb5wGzwLHD25hkkpRK1XL2A=; b=dx3RZv9bnJi1jPgHcRfoP55Dgx9K79m6CMpRjw5undP27/WZP7FmoP46XvoHA6bA7D hIu0tzrIsA+Qdbb8+FMmBKfGhrLlf3C/mnyL8ty6xisv9pePZ2z7FWWw6uX0fjewsVRv S3nxr+c3fGSqtEIMBINmfm31xPiiFi3nbOulsgGGt+53bj3Y2D02f3m3a0dzOdF+zgvS qGMeVTm6InHziZHy//jZyklAVNAr9LgDsFJk3PsF/VLbBEr7rKHpebTSGSR4YwJpKnNw mPXW7vPj7BtU6H/N6zgOWrL6jOMzNeKmtC9AFRLN3YDuRAOOZ8tffTIyYlhE9tkcAnrh bkkA== X-Gm-Message-State: AOAM532P+dhR9s+R+YS/xMChXuhyOy4jPVXd9JT9IW977FmJBuAWeKw4 rGZDnKbDYIqIaLbBeyyPwjwVx3YEf3wb3DfR X-Google-Smtp-Source: ABdhPJzTOE5iYsMHFuZeuwF1ArYQxpKzvw/6U4/NRCwTp50p0VZy+ktX5yiFwU/V0/bKJCNvYuebIg== X-Received: by 2002:ac8:4783:: with SMTP id k3mr28123811qtq.231.1615904653238; Tue, 16 Mar 2021 07:24:13 -0700 (PDT) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id t188sm15327165qke.91.2021.03.16.07.24.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Mar 2021 07:24:13 -0700 (PDT) To: Stefan Liebler , libc-alpha@sourceware.org References: <20210316135612.1400708-1-stli@linux.ibm.com> From: Adhemerval Zanella Subject: Re: [PATCH] Don't test nanoseconds for non-LFS interface in io/tst-stat.c Message-ID: Date: Tue, 16 Mar 2021 11:24:10 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210316135612.1400708-1-stli@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 16 Mar 2021 14:24:15 -0000 On 16/03/2021 10:56, Stefan Liebler wrote: > Both new tests io/tst-stat and io/tst-stat-lfs (_FILE_OFFSET_BITS=64) > are comparing the nanosecond fields with the statx result. Unfortunately > e.g. on s390(31bit) those fields are always zero if old KABI with non-LFS > support is used. With _FILE_OFFSET_BITS=64 stat is using statx internally. This might also happens for LFS interface if statx is not supported by the kernel, since the LFS call will fall back to the use the stat syscall that has this issue. Maybe it would be better to make it an internal tests and add a flag somewhere to just disable it for s390-32. > > As suggested by Adhemerval this patch disables the nanosecond check for > non-LFS interface. > --- > io/tst-stat.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/io/tst-stat.c b/io/tst-stat.c > index 445ac4176c..550128a2a5 100644 > --- a/io/tst-stat.c > +++ b/io/tst-stat.c > @@ -26,6 +26,20 @@ > #include > #include > #include > +#include > + > +#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 > +/* Test nanoseconds if LFS interface is requested. */ > +# define TEST_NANOSECONDS 1 > +#elif !XSTAT_IS_XSTAT64 > +/* LFS interface is not requested and we have no LFS support. E.g. s390(31bit) > + is using old KABI with old non-LFS support and the nanoseconds fields are > + always zero. */ > +# define TEST_NANOSECONDS 0 > +#else > +/* LFS interface is not requested, but we have LFS support. */ > +# define TEST_NANOSECONDS 1 > +#endif > > static void > stat_check (int fd, const char *path, struct stat *st) > @@ -91,9 +105,11 @@ do_test (void) > TEST_COMPARE (stx.stx_blocks, st.st_blocks); > > TEST_COMPARE (stx.stx_ctime.tv_sec, st.st_ctim.tv_sec); > - TEST_COMPARE (stx.stx_ctime.tv_nsec, st.st_ctim.tv_nsec); > TEST_COMPARE (stx.stx_mtime.tv_sec, st.st_mtim.tv_sec); > +#if TEST_NANOSECONDS > + TEST_COMPARE (stx.stx_ctime.tv_nsec, st.st_ctim.tv_nsec); > TEST_COMPARE (stx.stx_mtime.tv_nsec, st.st_mtim.tv_nsec); > +#endif > } > > return 0; >