Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp755086rwd; Tue, 16 May 2023 07:22:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5t9jL5xsT09UCbDRBXajhhhUPYYPjK2M3FectnhbWrmOzzI0yTwp4JRV3n3fL7lK3h+W99 X-Received: by 2002:a05:6a00:a15:b0:647:5409:5d0b with SMTP id p21-20020a056a000a1500b0064754095d0bmr38779334pfh.19.1684246924109; Tue, 16 May 2023 07:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684246924; cv=none; d=google.com; s=arc-20160816; b=a6nDtosVdreTdBYxrA6KrXK6uF7hRRDNcICtgNT0CI23E0xDzbKEN46t2/Ddm44H0J Vijk/2n0LtAD8hHQkVxqzHFHVx+GPENHyxJkj8ixJRcfqPDMm+dPiCLrrU1pYbHMFAoc GNH+RTO3HJN6+3AXSnBFCvXGfUTg0WNZGeKNMtK3cAYLVb/CTT91j0qEtyT6PW6SdjyW mp7uuu0B8xuE68P513vlfFrXd3RT4cHWbxpoGKf+QUEA+9ONvOz2+IriLd6EuC/2LaYc ylwewN1NajqK3qUZc+Dhwh4C2XEJLhJefRHjz3pj3+HvGqiz12x8QxWFWVrmWE9cBBhr KHpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=l4FSECm3pZHO2NnhyyZ175jEIWOQ4oCy1zG+qrhHjZE=; b=m2cknyXf1iGaMv5mS+l7mjjc/xv5AfYLqR0Y1HtwWbkuhZZFB+8YZaH592d9aCQ2d7 ACnlQ7HvSYiGYPTXvWsHmEXW7Yjtsswc3mcT7+mtbeFnkaTmuyqP+l4loyGeXtmsgh3h aYzhdgK9F2Uu7qcc3eBU6MKPGqyWcgnhyqFJG66T10DpjSw6fZnA+UuTlST841xYNK+w Vfz5owx5EBqjpzfyZcC4m6mSt1cxIWaqC+mAqKenxAHmbsXiwTg4XnaX3Gdj1OcGlqDO HMODiOI6Fp+OyRODRDHz2hyZHTF9lVqgyvRL9wpBR0JJuwGnov1AByxWtUqfLosLxhG3 SbNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hHRHUNOx; 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 bs130-20020a632888000000b0051b9a71329fsi17408093pgb.360.2023.05.16.07.21.47; Tue, 16 May 2023 07:22:04 -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=hHRHUNOx; 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 S233140AbjEPOOL (ORCPT + 99 others); Tue, 16 May 2023 10:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233883AbjEPOOK (ORCPT ); Tue, 16 May 2023 10:14:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C984CAB; Tue, 16 May 2023 07:14:09 -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 6776761B09; Tue, 16 May 2023 14:14:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66F59C433D2; Tue, 16 May 2023 14:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684246448; bh=saVZQYmRAyO5dOZw9EWySdWwQQL/yP/5bl9XqQuAVyg=; h=From:To:Cc:Subject:Date:From; b=hHRHUNOxOZ1Azow6vKLIi6u0CUmiB8otbjfuupQhm+S1L3ww5Yd9Gi7bwHTXwuPeS rTkqTiUDB+9d9ymBzBYmAVMpd7/x0jijEEvKs/dlxatLiVt6An+2aMZSImLB+L3e1p 2OwC7PYu67S7wa5Wb2DW0bu5oV76aMDJqONVLzNhTqs4jecSxp3jlefsCisZfvLD6M lKjyGuVEZPh11mW9nHOIaaCYaonWm/pHBLCCnqJK113E7CGENUqyrT81XWC4QXqSUv fd1nbFYDNLRqe0TFuB61d4Nl9ryD+bDMUqridNTib2RDLTpD/8hm5Q15bAczpC+aQN 0KoGpfiKM7SxQ== From: Anna Schumaker To: linux-nfs@vger.kernel.org, fstests@vger.kernel.org, zlang@redhat.com Cc: anna@kernel.org Subject: [PATCH v3] generic/728: Add a test for xattr ctime updates Date: Tue, 16 May 2023 10:14:07 -0400 Message-Id: <20230516141407.201674-1-anna@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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() +{ + what=$1 + shift 1 + + before_ctime=$(stat -c %z $TEST_DIR/testfile) + sleep 2 + $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