From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id F1A10385480F for ; Tue, 16 Mar 2021 19:59:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F1A10385480F Received: by mail-qk1-x72a.google.com with SMTP id n24so6429568qkh.9 for ; Tue, 16 Mar 2021 12:59:32 -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=sFGtSvqV/H2lNChHXlWt8ywZ/IP1n1bsJcv1PeyPCMk=; b=aQmIrmsnmZYg+sFk9yoCefYZnCPfbyj792LeSOB4fyRnDkqmwlT2H6t0C93sukEFb7 /gmfFfmbHAocP8dTePZNTB1ivJDglgxb6C4N99XQuT7+lX133O4FCWQnkcfG7P7hgyO+ OGp+DqNQ0912H11FhfZg6UsUZirtjlJzPjF1bWZR59JZ80dBpByaSwnP3HjFt5SH15bh Y9E875ieIn1rlL7q+dLfBQQJ2ubOG35/+N+7uUcUUKGTwoqx0S4ECO0DA2oSaQ1BLYrA YOZ7mpq8uh/ZkaUzmURenmnC1ygbV7ef1pOSBWwDvaG1LQBLslTqmvEevBuDtxzvzViD fqKA== X-Gm-Message-State: AOAM530QFUoGd7q7NdULWRgKp34cyYnhU2hwhwP5WVOr0gerkwLQfcAK 6WX7kr+V3QaQ/D0XNZVEtiCZ72EE4RKsMlHe X-Google-Smtp-Source: ABdhPJzDvyYcY02LVctowk4n5zfYzKZxubHSFZIRQETsawReliF65wZn93bYnQgKVEAe4uhfvNJ3Cg== X-Received: by 2002:a37:6f87:: with SMTP id k129mr798704qkc.470.1615924772438; Tue, 16 Mar 2021 12:59:32 -0700 (PDT) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id u11sm1392682qta.91.2021.03.16.12.59.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Mar 2021 12:59:32 -0700 (PDT) To: Stefan Liebler , libc-alpha@sourceware.org References: <20210316135612.1400708-1-stli@linux.ibm.com> <7eb4bf10-0ce2-03cd-d50f-f6bc0c8f4129@linux.ibm.com> From: Adhemerval Zanella Subject: Re: [PATCH] Don't test nanoseconds for non-LFS interface in io/tst-stat.c Message-ID: <83d8d464-d5c9-6c60-e8bd-2c95af97df7c@linaro.org> Date: Tue, 16 Mar 2021 16:59:29 -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: <7eb4bf10-0ce2-03cd-d50f-f6bc0c8f4129@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 19:59:34 -0000 On 16/03/2021 13:30, Stefan Liebler wrote: > On 16/03/2021 15:24, Adhemerval Zanella wrote: >> >> >> 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. >> > gcc is setting the macros __s390x__ and __s390__ on s390x(64bit), but > only __s390__ on s390(31bit). Thus I can detect s390(31bit) at > compile-time via "#if" and disable the nanoseconds checks on s390(31bit) > at all and run it on all other cases. Then I don't need to make the test > an internal test and don't need special flags. If this is okay for you, > I will prepare a further patch (also with a different subject). I think it would better to add such logic on libsupport instead directly on the test itself, similar to what support_path_support_time64 does. Maybe something like: bool support_stat_nanoseconds (void) { /* s390 stat64 compat symbol does not support nanoseconds resolution and it used on non-LFS [f,l]stat[at] implementations. */ #if defined __linux__ && !defined __s390x__ && defined __s390__ return false; #else return true; } Another possibility is if you want to fix it for s390 is to call statx on Linux non-LFS fstatat call (sysdeps/unix/sysv/linux/fstatat.c) which should fix stat, lstat, and fstat as well. You will need to add a stat to statx conversion at sysdeps/unix/sysv/linux/statx_cp.c which would need handle EOVERFLOW on st_ino, st_size, and st_blocks.