Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp406063rwr; Thu, 4 May 2023 22:01:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GCXZs25bBc0ViA2VJV7opY5fHtySk7Kg/7F6m7mEaDMFbLVlJYB0vVGGUyINRlu/mdg0A X-Received: by 2002:a05:6a00:1696:b0:633:c311:c70d with SMTP id k22-20020a056a00169600b00633c311c70dmr810645pfc.14.1683262911564; Thu, 04 May 2023 22:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683262911; cv=none; d=google.com; s=arc-20160816; b=ReUnU7L/DAyvONcFtt4c2+YRh+OdkzW/4tQWB0N1zu7nK5fU+hhTCUVAm9w3mWum+L RJRyr/e/RTLtDsncEA0G+iD0EhRNCozh9xbrjL2zXPJWiBlrwTeT9xczZPc5nUaIQxn7 yz6ws4K7BwG7k5PewE0Z5RRD0QbdWigAGLq3E+LFWlqOf3l87BEjbxXcZrDFr4Ey84Tk cqyVHaQiMHAzcyncUCyI0L73lruPkI8TMBAVfhDrln2wo4veXiPR694MItwcYeUmfhuP ty8keLds/Gj3/9d6rysFrnNTxRDtPABQK7Up6nlBH4rr8h/D631wANxvKCid12SOGLZC qqlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dtinxNP6pyEAADcAheaRiWg2W9bzRumM0aISKTp3vB4=; b=qzeXQnpfVM/UpV3mWV30ScDZScTjskckXyJWvPsJB5k69WQ2ISzxSdWy3aOsPDRRRy cfgOMu+xDHTmez830ppcCKs+o2/1nAuV1NzjLOsEslLn/kOmAL9zZShMKzvj2CC50sz/ /2/cGTXFsRzWeXEZmbmX64PVIzEFYD/Mg/F6rIXDrUtMV04G0Y+wZ3RVA8PEnnk+azQW 5U9FApT63cst5UI0zuXaCLqhxkC6s1zfw2GnGH5nJBP25a1ZIwHCo0mMHWKOlEUCv1P5 QDTAbrDK7LvRPL7BEVDboQZFRb+J/nX11/NPjJ+rk/6Bo0kARir+iAgmo/1yI/TmIB3v EFZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="BFCfv/UH"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020aa79ad0000000b006435b08fee8si1150122pfp.196.2023.05.04.22.01.27; Thu, 04 May 2023 22:01:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="BFCfv/UH"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229875AbjEEEpx (ORCPT + 99 others); Fri, 5 May 2023 00:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbjEEEpx (ORCPT ); Fri, 5 May 2023 00:45:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 901E7124B7 for ; Thu, 4 May 2023 21:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683261905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dtinxNP6pyEAADcAheaRiWg2W9bzRumM0aISKTp3vB4=; b=BFCfv/UHnq9ratDXNpnd2JIWsir4lkQSlvMcJmBJvuphZtomcE9huihaxiuJ6KJNaVpU9h tc6TD1kSq3uk2Yw1pebE0qnsFR+BhQKVjj/7guFpyV1zEE4IuPlkkjsrnIukgDQ36HgYYT EOuyGThtB1y9qilHpvb5gzbpoC+GyIU= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-wGrt4RIyPrujBrMT9UrScQ-1; Fri, 05 May 2023 00:45:04 -0400 X-MC-Unique: wGrt4RIyPrujBrMT9UrScQ-1 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-24e1d272afaso643337a91.3 for ; Thu, 04 May 2023 21:45:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683261903; x=1685853903; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dtinxNP6pyEAADcAheaRiWg2W9bzRumM0aISKTp3vB4=; b=UuBUewQrl/pRBQba/+RtGIsWsVREkh/QdEA1v2ldMSklm1CQJba4oeVL3fqAowv1Sh co/dBe+pfDJhXAAEZOH/UrgmjVRGbTlCryN2WF67WWyA1nA4r30GGlY2JQOOfl3xjcRN LT6htOjEXGtr55nKiPYXINMrXfgBSQ4WSwPmHLDtSGs2IyyUHpvKWyORSOHA/cB9d8BT NkrlFVeY+HVwFDLD8UK6NR9MKtfCwZXAyJQQXPrHjll1Ci+Y/+Hiiq8FeoVPrG5jZieq 4JWM2z3vllA7Tbt9350emlaKTKzeXnHL1vV8Nyl/cTuw5XGOhfen5Kr2+8pitzsa8ufq Sh1A== X-Gm-Message-State: AC+VfDw/kvSVVWJsyxYvrGT3BXPt3xIDlkkBxXRvt75nlmmtq2JiFSAJ 3Mj47++JMGzOtNmyGqiDCsjeTpRT1kzq/dRwA/17L8ncf9y3FfpFyEXHlexgcqd300/JdCEHFIN ShLXL754VmMnBbjJVBDssmOILGFt43wQ= X-Received: by 2002:a17:90b:4f8e:b0:24f:fdaa:53a8 with SMTP id qe14-20020a17090b4f8e00b0024ffdaa53a8mr153130pjb.37.1683261903160; Thu, 04 May 2023 21:45:03 -0700 (PDT) X-Received: by 2002:a17:90b:4f8e:b0:24f:fdaa:53a8 with SMTP id qe14-20020a17090b4f8e00b0024ffdaa53a8mr153113pjb.37.1683261902785; Thu, 04 May 2023 21:45:02 -0700 (PDT) Received: from zlang-mailbox ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id bg7-20020a1709028e8700b001ab12ccc2a7sm544485plb.98.2023.05.04.21.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 21:45:02 -0700 (PDT) Date: Fri, 5 May 2023 12:44:58 +0800 From: Zorro Lang To: Anna Schumaker Cc: linux-nfs@vger.kernel.org, fstests@vger.kernel.org Subject: Re: [PATCH] nfs/002: Add a test for xattr ctime updates Message-ID: <20230505044458.wrvhvamrkcuqin3z@zlang-mailbox> References: <20230504204847.405037-1-anna@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230504204847.405037-1-anna@kernel.org> X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, May 04, 2023 at 04:48:47PM -0400, Anna Schumaker wrote: > From: Anna Schumaker > > The NFS client wasn't updating ctime after a setxattr request. This is a > test written while fixing the bug. > > Signed-off-by: Anna Schumaker > --- > tests/nfs/002 | 39 +++++++++++++++++++++++++++++++++++++++ > tests/nfs/002.out | 2 ++ > 2 files changed, 41 insertions(+) > create mode 100755 tests/nfs/002 > create mode 100644 tests/nfs/002.out > > diff --git a/tests/nfs/002 b/tests/nfs/002 > new file mode 100755 > index 000000000000..5bfedef6c57d > --- /dev/null > +++ b/tests/nfs/002 > @@ -0,0 +1,39 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2023 Netapp Inc., All Rights Reserved. > +# > +# FS QA Test 002 > +# > +# Test a bug whene the NFS client wasn't sending a post-op GETATTR to the > +# server after setting an xattr, resulting in `stat` reporting a stale ctime. > +# > +. ./common/preamble > +_begin_fstest auto quick attr > + > +# Import common functions > +. ./common/filter > +. ./common/attr > + > +# real QA test starts here > +_supported_fs nfs Great, a new nfs test case! > +_require_test_nfs_version 4.2 But I'm wondering if this case can be a generic test case, due to the operations in this case are common (need xattr and ctime support), don't depend on any nfs specific features/operations. Not sure why nfs4.2 is necessary, can it be removed or replaced ? Thanks, Zorro > +_require_attrs > + > +touch $TEST_DIR/testfile > + > +before_ctime=$(stat -c %z $TEST_DIR/testfile) > +$SETFATTR_PROG -n user.foobar -v 123 $TEST_DIR/testfile > +after_ctime=$(stat -c %z $TEST_DIR/testfile) > + > +test "$before_ctime" != "$after_ctime" || echo "Expected ctime to change." > + > + > +before_ctime=$after_ctime > +$SETFATTR_PROG -x user.foobar $TEST_DIR/testfile > +after_ctime=$(stat -c %z $TEST_DIR/testfile) > + > +test "$before_ctime" != "$after_ctime" || echo "Expected ctime to change." > + > +echo "Silence is golden" > +status=0 > +exit > diff --git a/tests/nfs/002.out b/tests/nfs/002.out > new file mode 100644 > index 000000000000..61705c7cc203 > --- /dev/null > +++ b/tests/nfs/002.out > @@ -0,0 +1,2 @@ > +QA output created by 002 > +Silence is golden > -- > 2.40.1 >