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=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 995A0C48BE0 for ; Fri, 21 Jun 2019 13:52:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73C3B2083B for ; Fri, 21 Jun 2019 13:52:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="talyJMTc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726066AbfFUNw4 (ORCPT ); Fri, 21 Jun 2019 09:52:56 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40817 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfFUNwz (ORCPT ); Fri, 21 Jun 2019 09:52:55 -0400 Received: by mail-pg1-f193.google.com with SMTP id w10so3410110pgj.7; Fri, 21 Jun 2019 06:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2gtphzP/bpRDT8GjhjgIxtYXvKqMZkcliLBFJW0ibC4=; b=talyJMTcjpuLq4hTvxk6zEfv7IpP8BLN6kEH5TTIKlIYbwlc3hW3gcrzAB4O/gOtUF BETBQXXtDsu4wq2W7CZWkUOgvmkr7l+bY4E7g+yrl+ztj3ETe06KTofV3rV8P5mUJjWW sEVg6S907XWCGiywDWy3Bx9dG/yZ19bOwH2sen+/uwr7UohD2jCZohT2vIbRMaFhDaEb EY32TYKMdi+ikdJm+wF0rHTn/lATXlvJErgA2AZRTwNhNbmipWa6DDqM3c95YMyLDNr6 9zXUIilsnatphjim8mOIxWLd801oUZV9FgjMDb+7tZXFI5I8s8qOgRipFLb46eIM6Y5h hvNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2gtphzP/bpRDT8GjhjgIxtYXvKqMZkcliLBFJW0ibC4=; b=HxJa73jqL72hXk64QBS8OClCddpNTShw72b6arJalGwsbx4Xp0uHD61xAfrQJ9l4n9 QnGMFbN6x/gVqItw1RPAOzgH8GetGZqBFRVq/BegvOLuR0qcKRaHwFTCfB0Yrs2gqmvM PHhCpr3YlBgublOtB6oiB+flC51uQFOdR1xKN0Gjoz/bUq3CxWD9zctOG6qFUzhrnvTZ P0/zZA/FRItx4BwDQ8Fr4ARoTHF3nmVtp4KnvJSLnEzEud37TzYX5uc2Kapzwn195Du0 /yavM9NrduaciG+XCHAYwgQy6aik/IZQTqtMsmg2kHnd+expDhiXTh7DDEyZ5UneBTVY YfKQ== X-Gm-Message-State: APjAAAVPnqVoSwFnuoY7fqcczWFV+pJ/f7/YjsPZgTJD90qfzDmv/4+q 3eTBQLEc0xUUy4J/ghfaP5o= X-Google-Smtp-Source: APXvYqwyqVS83chhaxEVGyd7C1vG6DVEpokUX1qngS21+FM3kmKFMvR9A1zCepjypDdS+DFiZlzciw== X-Received: by 2002:a65:64d6:: with SMTP id t22mr19026058pgv.406.1561125175021; Fri, 21 Jun 2019 06:52:55 -0700 (PDT) Received: from localhost ([178.128.102.47]) by smtp.gmail.com with ESMTPSA id c26sm2836654pfr.172.2019.06.21.06.52.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 21 Jun 2019 06:52:53 -0700 (PDT) Date: Fri, 21 Jun 2019 21:52:47 +0800 From: Eryu Guan To: Filipe Manana Cc: fstests , linux-btrfs , Filipe Manana Subject: Re: [PATCH 2/2] generic/059: also test that the file's mtime and ctime are updated Message-ID: <20190621135247.GL15846@desktop> References: <20190619120624.9922-1-fdmanana@kernel.org> <20190621103642.GK15846@desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, Jun 21, 2019 at 11:48:57AM +0100, Filipe Manana wrote: > On Fri, Jun 21, 2019 at 11:36 AM Eryu Guan wrote: > > > > On Wed, Jun 19, 2019 at 01:06:24PM +0100, fdmanana@kernel.org wrote: > > > From: Filipe Manana > > > > > > Test as well that hole punch operations that affect a single file block > > > also update the file's mtime and ctime. > > > > > > This is motivated by a bug a found in btrfs which is fixed by the > > > following patch for the linux kernel: > > > > > > "Btrfs: add missing inode version, ctime and mtime updates when > > > punching hole" > > > > > > Signed-off-by: Filipe Manana > > > --- > > > tests/generic/059 | 18 ++++++++++++++++++ > > > 1 file changed, 18 insertions(+) > > > > > > diff --git a/tests/generic/059 b/tests/generic/059 > > > index e8cb93d8..fd44b2ea 100755 > > > --- a/tests/generic/059 > > > +++ b/tests/generic/059 > > > @@ -18,6 +18,9 @@ > > > # > > > # Btrfs: add missing inode update when punching hole > > > # > > > +# Also test the mtime and ctime properties of the file change after punching > > > +# holes with ranges that operate only on a single block of the file. > > > +# > > > seq=`basename $0` > > > seqres=$RESULT_DIR/$seq > > > echo "QA output created by $seq" > > > @@ -68,6 +71,13 @@ $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo > > > # fsync log. > > > sync > > > > > > +# Sleep for 1 second, because we want to check that the next punch operations we > > > +# do update the file's mtime and ctime. > > > +sleep 1 > > > > Is this supposed to be after recording the initial c/mtime? i.e. moving > > it after c/mtime_before? > > Either way is fine. Capturing the times right before or right after > the sleep, gives the same values as nothing changed the file. Ah, you're right. > > Btw, I had noticed the other day that the second "echo" has > $mtime_after instead of $ctime_after (copy-paste mistake). > Do you want me to send a v2 fixing that typo, or you can do it > yourself when you pick the patch? I can fix it on commit, thanks for pointing it out! Thanks, Eryu