From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77FAF2EA732 for ; Fri, 24 Jul 2026 03:12:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784862762; cv=none; b=QySdqugYv5awV7D+aVTt0ADWicraSZalnKnNAA2jnIaj4voz4W9m5qMEQeCKuLWn9zMpJV+SUeHB175M/6pj7MBaiI55IHiRMqfGc1lG52cH8Tb91BNUNDhIddHLO1TNvJevGs/mn/AAykti5ygHAp4gjmNbBg/RufTMUZ9xfSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784862762; c=relaxed/simple; bh=aqWYy4XHl3Uk9dnzohMfed5zvqMLLmOBOwj3KGLNJaE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sxnWpz+F6tWrC/4NR3hkgcDfMegjRNFpmQt5/LgGt529DWKfVXScpzNmITcPw6LtC6XJNv9S1fE7mUppDeao/lj+x8ZiGKHAqyzgjIgThf9bRMnDjH/0Y8Dj2C8GZvIF82QdN3eIt3TN/5HcG6S8nDQ0KmoZytGCvx3buBz39r8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chenxiaosong.com; spf=pass smtp.mailfrom=chenxiaosong.com; dkim=pass (2048-bit key) header.d=chenxiaosong.com header.i=@chenxiaosong.com header.b=awqYv1TS; arc=none smtp.client-ip=91.218.175.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chenxiaosong.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chenxiaosong.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=chenxiaosong.com header.i=@chenxiaosong.com header.b="awqYv1TS" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chenxiaosong.com; s=key1; t=1784862756; 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: in-reply-to:in-reply-to:references:references; bh=7hxgXDG9yiqAUQ82oK2oHSAM7Qb+ekWttcrYUHtUpc0=; b=awqYv1TSM9HSAj6vxMdnefNqczhj+CJDUFs9QX4HaBst3mQMKgScHM942O8aXs7KLdVoBY MRB9opL1TwJxfJdfA6mNLUKo8yErCmApAR1UAdY8CjhXJAre3GQx7mg2g5BIZAyguxn3zz Fc6mhF7prEo11tq4io1p8tLuPE0HhUmrMp7EXyivXPVWafFDi4+i5KYxKquL9W18sqIVP3 hS9iXxVjUaTkFIfU3q4iutjxcGZ1By0fP/Tl5ViImsD3ceyyH81q/BVGk1jCEBb4pMLyMi d5WYIIcmxWNTDt7mmCXDYX7ISoMwfB27hJfX63j1MC3jT/Whavcgiz8b517HmA== From: ChenXiaoSong To: smfrench@gmail.com, linkinjeon@kernel.org, pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, senozhatsky@chromium.org, dhowells@redhat.com, metze@samba.org, zlang@kernel.org Cc: linux-cifs@vger.kernel.org, fstests@vger.kernel.org, ChenXiaoSong Subject: [PATCH v3 xfstests 1/2] generic/002: simplify the hardlink count test Date: Fri, 24 Jul 2026 03:12:09 +0000 Message-ID: <20260724031210.332153-2-chenxiaosong@chenxiaosong.com> In-Reply-To: <20260724031210.332153-1-chenxiaosong@chenxiaosong.com> References: <20260724031210.332153-1-chenxiaosong@chenxiaosong.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: ChenXiaoSong Add the test to the hardlink group and replace the enumerated link counts with arithmetic loops. Clean up the test header, use "Silence is golden" success message, and return the test status explicitly. Suggested-by: Zorro Lang Signed-off-by: ChenXiaoSong --- tests/generic/002 | 16 ++++++---------- tests/generic/002.out | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/generic/002 b/tests/generic/002 index 6df57a7a..9b210705 100755 --- a/tests/generic/002 +++ b/tests/generic/002 @@ -2,12 +2,12 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. # -# FS QA Test No. 002 +# FS QA Test 002 # # simple inode link count test for a regular file # . ./common/preamble -_begin_fstest metadata udf auto quick +_begin_fstest metadata udf auto quick hardlink # Import common functions. . ./common/filter @@ -17,14 +17,11 @@ status=0 # success is the default! _require_test _require_hardlinks -echo "Silence is goodness ..." - # ensure target directory exists mkdir `dirname $TEST_DIR/tmp` 2>/dev/null touch $TEST_DIR/tmp.1 -for l in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -do +for ((l = 2; l <= 20; l++)); do ln $TEST_DIR/tmp.1 $TEST_DIR/tmp.$l x=`$here/src/lstat64 $TEST_DIR/tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'` if [ "$l" -ne $x ] @@ -35,8 +32,7 @@ do fi done -for l in 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -do +for ((l = 20; l >= 1; l--)); do x=`$here/src/lstat64 $TEST_DIR/tmp.1 | sed -n -e '/ Links: /s/.*Links: *//p'` if [ "$l" -ne $x ] then @@ -47,5 +43,5 @@ do rm -f $TEST_DIR/tmp.$l done -# success, all done -exit +echo "Silence is golden" +exit $status diff --git a/tests/generic/002.out b/tests/generic/002.out index 11426b54..61705c7c 100644 --- a/tests/generic/002.out +++ b/tests/generic/002.out @@ -1,2 +1,2 @@ QA output created by 002 -Silence is goodness ... +Silence is golden -- 2.43.0