Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2205395rdb; Thu, 21 Sep 2023 11:24:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCVLWlLJ86FPJPv/GoJ5somkzAyL9bIpmzEVWkD2r8tjxrl3+LsDpIZDZNWc2UmzOapMwz X-Received: by 2002:a05:6808:618f:b0:3a4:24aa:b556 with SMTP id dn15-20020a056808618f00b003a424aab556mr5567853oib.13.1695320686950; Thu, 21 Sep 2023 11:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695320686; cv=none; d=google.com; s=arc-20160816; b=tZ2Tq32O+mwRL8V/FWEKVoVIweZj+RG9grJz3CWFNQ4RX5FyXZyG/7bQ/854ln35Vp TIdkvorfOmv4YcwAYNbSf5/xiaKucfXgTieswfmboGK8jG9fB0McrY/yUSgSd8/dvYwM uc7uC+YJPmFyupW8SxImZ/q5wOlWQSS2XT8kbuNCXeZR3wtP/9/4J98w6xBvA+L7PUlm woEOBrzEdPJPmP+8Wq/MRZApGZ49k3Z4K/YrBmzNZ0AQKIC2l2jwDGqk5PhYtwR43yvq SQDTWdIdtvvKcsY6S/iM1tMb6Vr9XThjP1lhLTo3FLw1m7ngpMGwA3hiwVH37bfnphHn +43A== 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=y0ax/dHqXYgyiJqtUUajFliIPWSkSwMmazUAOco5xqs=; fh=auG/NWGGuA8kSwrtoQ9oZ/OVd0ILnQCr1TUfk9ycDEY=; b=QblzX6Ay2yo0RWKzTv7jRf3PdMZyaP5/+IzK0eTL3nsC8lOq2RjLJJh9ygKvpu81VP ktkP4hJwzK0Ru17wPJBF2wQVYb7NkQ/IwABfAt2nZmBd0SmddMxrcpQY2BPrmjJjMGu5 +zFdogKC7QjIfqTEdtQbUh0c3GEl9jbM1xgmPkJdjpJSj4RSrRZm9U3h5DHQS8qriQPH 6lT6K+lEnte5bJj433YYxmQj4QuwlnUDs4lxI/tIMzcnLXMrMAmwV5fYPR9iAkdkqy6m dQtUz+MRGPoM3D8G7lLcJTccPbXWcVFg20bgPKFNwxbz0lQMtYlCZcYhlmgwYmsmofqc MaOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TEI6aqUb; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id r9-20020a632b09000000b00573f837821fsi1834140pgr.689.2023.09.21.11.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 11:24:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TEI6aqUb; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2A69A81BAA57; Thu, 21 Sep 2023 10:50:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjIURuG (ORCPT + 99 others); Thu, 21 Sep 2023 13:50:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbjIURtw (ORCPT ); Thu, 21 Sep 2023 13:49:52 -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 09E3330DE for ; Thu, 21 Sep 2023 10:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695315662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=y0ax/dHqXYgyiJqtUUajFliIPWSkSwMmazUAOco5xqs=; b=TEI6aqUbVo9sQq1gTJIfRc+NIY4cP8g40/AHd7FwigoBE4RLhn4Ob0A+JoxIRT5cXvBqfE mwDznkVQdE1cJ7fvVgwq59vyWJDoIaAE4//oj9j/V1R2fqOqJwOEQ8Ko3lYn6FBn8ZltVY uoh1X+6q/xigS8bnyPzCSwkllYQabHc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-68-3x0h7vyePY6Brrq1DpIKSA-1; Thu, 21 Sep 2023 09:44:09 -0400 X-MC-Unique: 3x0h7vyePY6Brrq1DpIKSA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 36D958030CB; Thu, 21 Sep 2023 13:44:09 +0000 (UTC) Received: from localhost (yoyang-vm.hosts.qa.psi.pek2.redhat.com [10.73.149.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90286C15BB8; Thu, 21 Sep 2023 13:44:08 +0000 (UTC) From: Yongcheng Yang To: fstests@vger.kernel.org Cc: linux-nfs@vger.kernel.org, zlang@redhat.com, Yongcheng Yang Subject: [PATCH] generic/471: add a test to check move in mountpoints of the same export Date: Thu, 21 Sep 2023 21:43:47 +0800 Message-Id: <20230921134347.839957-1-yoyang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 10:50:07 -0700 (PDT) Add a new test to ckeck file move (rename) operation among different mount points which are mounting to a same export. This should be a simple test but it recently unveils an ancient nfsd bug. Thus let's make it to be a regresstion check. Signed-off-by: Yongcheng Yang --- Hi, There is an ancient nfsd problem just pop up and is now resolved by the upstream commit [1]. Looks like it's a basic and simple test which is probably appropriate for the fstest IMO. This test in nfs will be failed without patch [1]: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [root@kvm-07-guest24 xfstests]# ./check -nfs generic/471 FSTYP -- nfs PLATFORM -- Linux/x86_64 kvm-07-guest24 5.14.0-abc.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Sep 13 04:59:08 EDT 2023 MKFS_OPTIONS -- localhost:/export_test2 MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 localhost:/export_test2 /mnt_scratch generic/471 1s ... - output mismatch (see /root/xfstests/results//generic/471.out.bad) --- tests/generic/471.out 2023-09-21 05:55:28.514673177 -0400 +++ /root/xfstests/results//generic/471.out.bad 2023-09-21 08:06:16.935695355 -0400 @@ -1,2 +1,3 @@ QA output created by 471 Silence is golden +mv: '/mnt_test/mountpoint1-471/A/f' and '/mnt_test/mountpoint1-471/B/f' are the same file ... (Run 'diff -u /root/xfstests/tests/generic/471.out /root/xfstests/results//generic/471.out.bad' to see the entire diff) HINT: You _MAY_ be missing kernel fix: fdd2630a739819 nfsd: fix change_info in NFSv4 RENAME replies Ran: generic/471 Failures: generic/471 Failed 1 of 1 tests [root@kvm-07-guest24 xfstests]# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ And it can pass after that patch [1] merged: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [root@fsqe-r6515-02 xfstests]# ./check -nfs generic/471 FSTYP -- nfs PLATFORM -- Linux/x86_64 fsqe-r6515-02 5.14.0-abcd.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Sep 19 08:10:36 EDT 2023 MKFS_OPTIONS -- localhost:/export_test1 MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 localhost:/export_test1 /mnt_scratch generic/471 0s Ran: generic/471 Passed all 1 tests [root@fsqe-r6515-02 xfstests]# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Also I have just checked the xfs and overlayfs but the latter get failed: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [root@fsqe-r6515-02 xfstests]# ./check generic/471 FSTYP -- xfs (non-debug) PLATFORM -- Linux/x86_64 fsqe-r6515-02 5.14.0-abcd.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Sep 19 08:10:36 EDT 2023 MKFS_OPTIONS -- -f /dev/loop1 MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/loop1 /mnt_scratch generic/471 0s ... 1s Ran: generic/471 Passed all 1 tests [root@fsqe-r6515-02 xfstests]# [root@fsqe-r6515-02 xfstests]# ./check -overlay generic/471 FSTYP -- overlay PLATFORM -- Linux/x86_64 fsqe-r6515-02 5.14.0-abcd.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Sep 19 08:10:36 EDT 2023 MKFS_OPTIONS -- /mnt_scratch MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /mnt_scratch /mnt_scratch/ovl-mnt generic/471 0s ... - output mismatch (see /root/xfstests/results//generic/471.out.bad) --- tests/generic/471.out 2023-09-21 09:02:14.580495256 -0400 +++ /root/xfstests/results//generic/471.out.bad 2023-09-21 09:02:51.145345830 -0400 @@ -1,2 +1,3 @@ QA output created by 471 Silence is golden +mv: '/mnt_test/ovl-mnt/mountpoint1-471/A/f' and '/mnt_test/ovl-mnt/mountpoint1-471/B/f' are the same file ... (Run 'diff -u /root/xfstests/tests/generic/471.out /root/xfstests/results//generic/471.out.bad' to see the entire diff) Ran: generic/471 Failures: generic/471 Failed 1 of 1 tests [root@fsqe-r6515-02 xfstests]# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For now I'm not sure if the overlayfs don't support this operation or we just need to fix that. Thanks, Yongcheng [1] https://lore.kernel.org/linux-nfs/ZPyMyv1nNFV2whKP@tissot.1015granger.net/T/#t tests/generic/471 | 60 +++++++++++++++++++++++++++++++++++++++++++ tests/generic/471.out | 2 ++ 2 files changed, 62 insertions(+) create mode 100755 tests/generic/471 create mode 100644 tests/generic/471.out diff --git a/tests/generic/471 b/tests/generic/471 new file mode 100755 index 00000000..ada48129 --- /dev/null +++ b/tests/generic/471 @@ -0,0 +1,60 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2023 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test 471 +# +# Mount the same export to different mount points and move (rename) +# files among those mount points. +# This simple test recently unveils an ancient nfsd bug that is fixed +# by fdd2630a739819 ("nfsd: fix change_info in NFSv4 RENAME replies"). +# +. ./common/preamble +_begin_fstest auto quick + +# Override the default cleanup function. +_cleanup() +{ + $UMOUNT_PROG $testdir1 2>/dev/null + $UMOUNT_PROG $testdir2 2>/dev/null + cd / + rm -r -f $tmp.* +} + +# real QA test starts here + +_supported_fs generic +[ "$FSTYP" = "nfs" ] && \ + _fixed_by_kernel_commit fdd2630a739819 \ + "nfsd: fix change_info in NFSv4 RENAME replies" + +_require_test +_require_scratch + +echo "Silence is golden" + +_scratch_mkfs >> $seqres.full +testdir1=$TEST_DIR/mountpoint1-$seq +testdir2=$TEST_DIR/mountpoint2-$seq +rm -rf $testdir1 $testdir2 +mkdir -p $testdir1 $testdir2 + +# Don't share the data and attribute caches among mount points for NFS. +# This caching behavior is necessary to reproduce this issue as we're +# checking the alignment of each mount point's own unique cache. +[ "$FSTYP" = "nfs" ] && MOUNT_OPTIONS="-o nosharecache" + +SCRATCH_MNT=$testdir1 _scratch_mount +SCRATCH_MNT=$testdir2 _scratch_mount +rm -rf $testdir1/{A,B} +mkdir $testdir1/{A,B} +touch $testdir1/A/f +mv $testdir1/A/f $testdir1/B/ +cat $testdir2/B/f +mv $testdir2/B/f $testdir2/A/ +cat $testdir1/A/f +mv $testdir1/A/f $testdir1/B/ + +# success, all done +status=0 +exit diff --git a/tests/generic/471.out b/tests/generic/471.out new file mode 100644 index 00000000..260f629e --- /dev/null +++ b/tests/generic/471.out @@ -0,0 +1,2 @@ +QA output created by 471 +Silence is golden -- 2.31.1