From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34E46C33C9E for ; Fri, 17 Jan 2020 21:34:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08B552072E for ; Fri, 17 Jan 2020 21:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729516AbgAQVeL (ORCPT ); Fri, 17 Jan 2020 16:34:11 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:59947 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726587AbgAQVeK (ORCPT ); Fri, 17 Jan 2020 16:34:10 -0500 Received: from callcc.thunk.org (guestnat-104-133-0-111.corp.google.com [104.133.0.111] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 00HLXq7b017717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jan 2020 16:33:53 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 696124207DF; Fri, 17 Jan 2020 16:33:52 -0500 (EST) Date: Fri, 17 Jan 2020 16:33:52 -0500 From: "Theodore Y. Ts'o" To: Jan Stancek Cc: Naresh Kamboju , adilger@dilger.ca, LTP List , Daniel Lezcano , Arnd Bergmann , open list , lkft-triage@lists.linaro.org, chrubis , linux-ext4@vger.kernel.org Subject: Re: LTP: statx06: FAIL: Birth time < before time Message-ID: <20200117213352.GA481935@mit.edu> References: <1555311261.2497849.1579281887353.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1555311261.2497849.1579281887353.JavaMail.zimbra@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2020 at 12:24:47PM -0500, Jan Stancek wrote: > > LTP syscalls statx06 test case getting failed from linux next 20200115 > > tag onwards on all x86_64, i386, arm and arm64 devices > > > > Test output: > > statx06.c:152: FAIL: Birth time < before time > > [CC Theo & linux-ext4] > > It's returning '0' in stx_btime for STATX_ALL or STATX_BTIME. > > Looking at changes, I suspect: > commit 927353987d503b24e1813245563cde0c6167af6e > Author: Theodore Ts'o > Date: Thu Nov 28 22:26:51 2019 -0500 > ext4: avoid fetching btime in ext4_getattr() unless requested > > and that perhaps it should be instead... > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index c8355f022e6e..6d76eb6d2e7f 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -5398,7 +5398,7 @@ int ext4_getattr(const struct path *path, struct kstat *stat, > struct ext4_inode_info *ei = EXT4_I(inode); > unsigned int flags; > > - if ((query_flags & STATX_BTIME) && > + if ((request_mask & STATX_BTIME) && > EXT4_FITS_IN_INODE(raw_inode, ei, i_crtime)) { > stat->result_mask |= STATX_BTIME; > stat->btime.tv_sec = ei->i_crtime.tv_sec; Yep, nice catch! Unfortunately we don't have a test like this in xfstests, or I would have caught this sooner. I've fixed this in the dev branch, so it will hopefully be fixed in the future linux-next tgs. - Ted