Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp819627rwd; Tue, 16 May 2023 08:06:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7FDqqS1fxsyqu7qiI3nano2+JRjwzXnTJq+qlFwixHzhQLgSHHTly6GYe1AAJlltt5u04O X-Received: by 2002:a17:902:c40a:b0:1ab:1624:38cf with SMTP id k10-20020a170902c40a00b001ab162438cfmr57809819plk.60.1684249588372; Tue, 16 May 2023 08:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684249588; cv=none; d=google.com; s=arc-20160816; b=C5FMOipB4ySN3gwMB2vA+Xl+YKU0w/cG8IexqGIW7WYsNDg2uEWi7/4zpOpW6QCKiv C9mg149uRa6P+BPerT565eqlC8HJBjDl/KiMsaqKiMFHc2N3cUL1HuGEtIqRrwxTOR1O RaXx3Kki7uNkZxnSOIbcqhXLWdvHO6q5XgxnDpFYSWt4Lj451N8ZZDHz9TPneuyo1IjO 2Y92BfhgR4AhSmRaC1eqZdlz8CBK0HxLk4u9K4eZyP/8dEPwsiWfQHCenpmdpFC9Rfx+ gZTG6+oup82HyfEoU6wXmvoxoVNj/DCqeIgNuFOvYi3FmRibftLQZa3PeeLmerzt494N 4gaA== 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=H3Mym8b6CjL+HRIR85yZUlxFDKQ2uBePyLvuHnLF+54=; b=0heNPrejlL6aj+jjxDqjayjES660z4gQAVuQmp/t39DCETNnIthhKM2VlRMSk5j2Oz sKvpSGeWFchZN0goBD2VVxBJ0LI9AA0t0a5sxgINF5+R1dMdcZH4k8sb2V7ng20hOJbD 5hvNQS/4pQL0lpFUn65imviDyJ5KU2iVd53ME5QisXpb6INyyVpt+ZtRgl3mR4ui8Oh0 /oDY67ssHkQZAzkwSLJfbAjnT7uu3tr/qIUe68AA4xe618qYxQGMksMVguTlCxIxa+V+ EObbCoE8/oSKR578ZYkziwlUyBmf7w8nC4QNphRibvMJHWbmgkYv61XlCuGKPTkES6hO yDBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="YxeCMFc/"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b001a8102f5d7fsi16889894plr.504.2023.05.16.08.06.06; Tue, 16 May 2023 08:06:28 -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=@kernel.org header.s=k20201202 header.b="YxeCMFc/"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233061AbjEPPAg (ORCPT + 99 others); Tue, 16 May 2023 11:00:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233325AbjEPPAa (ORCPT ); Tue, 16 May 2023 11:00:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79E554487; Tue, 16 May 2023 08:00:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1CE5C62848; Tue, 16 May 2023 15:00:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81940C433D2; Tue, 16 May 2023 15:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684249228; bh=Nn2s+2bIiaTZdGebq+VZ2gTYpRfgXxTZZanKy2Bqze4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YxeCMFc/HZW21O3XAx/9Ecorg4UjhGccbhvUmqw1YPFJlJ0uakCBTjE0WXvvH6ObF JMhmB91dirsabyy6uS5BhZBJ1yooIWrnel5qjtcTDJpZOkHQySzXiHkEKyuCag1bL7 rDsi8sVi87T0OGI59goCdcCDh3U/DgOPdKR9+J5iZ9aP/CxYQP7R0tYzlHKhpXMtWs kulPtypjrg+sDModF1NfQPDn46wuBweuZjBUTxzdRx7JskQU1x3/n54X+K/HNlDbYi GPIAgzPyW6VFRqm2TN3GWUcgXu/le1x0cyb3d57jvok3LIO2DhAeR9NDZfk8z5WU6H EUWjKlOa4hedA== Date: Tue, 16 May 2023 08:00:27 -0700 From: "Darrick J. Wong" To: Anna Schumaker Cc: linux-nfs@vger.kernel.org, fstests@vger.kernel.org, zlang@redhat.com Subject: Re: [PATCH v3] generic/728: Add a test for xattr ctime updates Message-ID: <20230516150027.GB858795@frogsfrogsfrogs> References: <20230516141407.201674-1-anna@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230516141407.201674-1-anna@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, May 16, 2023 at 10:14:07AM -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 > > --- > v3: > - Add a 2 second sleep before changing the xattr > > v2: > - Move test to generic/ > - Address comments from the mailing list > --- > tests/generic/728 | 43 +++++++++++++++++++++++++++++++++++++++++++ > tests/generic/728.out | 2 ++ > 2 files changed, 45 insertions(+) > create mode 100755 tests/generic/728 > create mode 100644 tests/generic/728.out > > diff --git a/tests/generic/728 b/tests/generic/728 > new file mode 100755 > index 000000000000..8e52eb4b219c > --- /dev/null > +++ b/tests/generic/728 > @@ -0,0 +1,43 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2023 Netapp Inc., All Rights Reserved. > +# > +# FS QA Test 728 > +# > +# Test a bug where 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/attr > + > +# real QA test starts here > +_supported_fs generic > +_require_test > +_require_attrs > + > +rm -rf $TEST_DIR/testfile > +touch $TEST_DIR/testfile > + > + > +_check_xattr_op() nit: only common/* functions are supposed to have a leading underscore in the name. > +{ > + what=$1 > + shift 1 > + > + before_ctime=$(stat -c %z $TEST_DIR/testfile) > + sleep 2 I think it would be useful to document that 2 seconds is the worst ctime granularity that we expect from any filesystem (fat) that might pass through fstests. Just in case, you know, we /ever/ create a fsinfo call to export information like that, and need to refactor all these 'sleep 2'. "sleep 2 # maximum known ctime granularity is 2s for fat" With those two things fixed, Reviewed-by: Darrick J. Wong --D > + $SETFATTR_PROG $* $TEST_DIR/testfile > + after_ctime=$(stat -c %z $TEST_DIR/testfile) > + > + test "$before_ctime" != "$after_ctime" || echo "Expected ctime to change after $what." > +} > + > +_check_xattr_op setxattr -n user.foobar -v 123 > +_check_xattr_op removexattr -x user.foobar > + > +echo "Silence is golden" > +status=0 > +exit > diff --git a/tests/generic/728.out b/tests/generic/728.out > new file mode 100644 > index 000000000000..ab39f45fe5da > --- /dev/null > +++ b/tests/generic/728.out > @@ -0,0 +1,2 @@ > +QA output created by 728 > +Silence is golden > -- > 2.40.1 >