From patchwork Thu Mar 6 08:18:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 14003976 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7CC851A238D for ; Thu, 6 Mar 2025 08:18:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741249103; cv=none; b=p2GoMbzj0oAdeIjd7MkbzS9O5Pe56qU0UCMqPwMFfFH+gGImcUwlVBlxwZVPdF6K1rDjhvnaT/eKiKkbNKl8S0CVHYcf/R4Bt/M3c1gIUcH8DbHwKN9cddq437dNo9JhopJJKqlv2vHVLdZf5UsFv2n6Bu9hPmtCiISFKq5Nz3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741249103; c=relaxed/simple; bh=RWP4wpZ3zNZLUM147XjXn5XnwdN3KEQbeXE8EZAKops=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZzcEg7oTSGPgKtCyoFpbHgoMcvEY6JugDQPkuJsOzmdMJpR69U+wnuqRDvbdKaWM8X9gLyhmQFCq3xSEHUiHBAls7LuREnD783T5oKuSqmpVqHIE7jm/SQlO34gniafU3H8DzhfvHK5M1fRDSlXRWof0jHLqNRO9PteJ/IrF/6M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZjBC3Psr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZjBC3Psr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC685C4CEE0; Thu, 6 Mar 2025 08:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741249102; bh=RWP4wpZ3zNZLUM147XjXn5XnwdN3KEQbeXE8EZAKops=; h=From:To:Cc:Subject:Date:From; b=ZjBC3PsrECQaYu2hurjO31ZdC5Txicqu8AlfPeIytdzmAl9ORsxLUzwuwZMDma/fN fWgKcrqMzfXOJwe5q9rxQJ9ppEHyuVAez6CmhCe6FhKi+apJzckE88rx1/q4HqVj+4 BPMB7FZL8I6iIAaoA22khI95RZ+sN1jiGsAq+2tZk21kcZdJRHhk4c630moatZhDq4 eiOUgSFwcOh9ON+GlBA1LzobnfttFonoUpZDAFcpJBioMSv1Idr31TKmDLy9iXq1ko MlNS3LfKZY0IpuGS01UVv9b1JeNdEp1GSbFpIox8YN1rzv45pFKEMxe36JODqDxnmJ F5jxxj/eaZCPA== From: Chao Yu To: Zorro Lang , fstests@vger.kernel.org Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, Chao Yu Subject: [PATCH 1/4] common/config: remove redundant export of F2FS_IO_PROG Date: Thu, 6 Mar 2025 16:18:06 +0800 Message-ID: <20250306081809.2397527-1-chao@kernel.org> X-Mailer: git-send-email 2.49.0.rc0.332.g42c0ae87b1-goog Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 F2FS_IO_PROG was been exported twice, remove the redudant one. Cc: Jaegeuk Kim Signed-off-by: Chao Yu Reviewed-by: David Disseldorp --- common/config | 1 - 1 file changed, 1 deletion(-) diff --git a/common/config b/common/config index 2afbda14..8d3047a5 100644 --- a/common/config +++ b/common/config @@ -191,7 +191,6 @@ export XFS_COPY_PROG="$(type -P xfs_copy)" export FSTRIM_PROG="$(type -P fstrim)" export DUMPE2FS_PROG="$(type -P dumpe2fs)" export RESIZE2FS_PROG="$(type -P resize2fs)" -export F2FS_IO_PROG="$(type -P f2fs_io)" export FIO_PROG="$(type -P fio)" export FILEFRAG_PROG="$(type -P filefrag)" export E4DEFRAG_PROG="$(type -P e4defrag)" From patchwork Thu Mar 6 08:18:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 14003977 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 18C3F18DB05 for ; Thu, 6 Mar 2025 08:18:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741249105; cv=none; b=AkiSlGeD7cxOPABVNPHh6vHh8C1mNQ2MGPRZa+PusDWxuOK+VHYSaYDfG++B7q4Z+SHb3i9RXKfqxjnH03hIhB/K+SZsEtJ6Y0Hc0Q3fokxHBHn5/TzmNsO1MHeuzVE0QbVi1as2vek9iC/jLKqdBIHlaPRg6C7btxoZVIKptNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741249105; c=relaxed/simple; bh=VrrK9AFZRA6UMEjtPkjMxvGnlxlx7x8Uy5ufhbEEAww=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vyjiao6+7Ebk14BT+fc1y2OzUFV5+/7FcOKdFwlMvJjh+8FrWh5XK5dsnH5txvGxiReVuUjGQBleKu0736ZBcoxtaRpjJoSdKpr/CWACPqP3yRKnXl8BUcFfmtHVn1sdMuME1Ybn+o0TjQi5kv/W8jHnwVvfEvVcV2M9ekN/v+g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eFGp+6Tx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eFGp+6Tx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 599DDC4CEE8; Thu, 6 Mar 2025 08:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741249104; bh=VrrK9AFZRA6UMEjtPkjMxvGnlxlx7x8Uy5ufhbEEAww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eFGp+6Txq7C8BnICguj+q74x75dKCWS+Eqkf5/rXeITQRbuKfc46W6tYpblbXDNSV YOuubn0U6KBU76sIDHvg92ijW43lMBDhPen0IECNhwbXXoqfGDU2Gu3iRKL7I+/yqg 2zAeYHZtK4TygG1fcWXBOgg7zaRNjPxpGFjXxpEbSOuVS6YO+mOYqGSVhg5ItSWD0i yqTuTxF5qYa76N+5900ncDOOcdw+uY1rGwnDnCNNoL01jwA7EnnbfP2pwg3mCm/K9F u4mgOvN51p0bNlLhDPp2OYJ+KRETSM5/Itk2HW1piccKHznQnvRT39vTqN0m6hH1kW v1nuxWB+502cA== From: Chao Yu To: Zorro Lang , fstests@vger.kernel.org Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, Chao Yu Subject: [PATCH 2/4] common/config: export F2FS_INJECT_PROG Date: Thu, 6 Mar 2025 16:18:07 +0800 Message-ID: <20250306081809.2397527-2-chao@kernel.org> X-Mailer: git-send-email 2.49.0.rc0.332.g42c0ae87b1-goog In-Reply-To: <20250306081809.2397527-1-chao@kernel.org> References: <20250306081809.2397527-1-chao@kernel.org> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 export F2FS_INJECT_PROG w/ inject.f2fs, it can be used for fault injection. Cc: Jaegeuk Kim Signed-off-by: Chao Yu Reviewed-by: David Disseldorp --- common/config | 1 + 1 file changed, 1 insertion(+) diff --git a/common/config b/common/config index 8d3047a5..05f192ea 100644 --- a/common/config +++ b/common/config @@ -317,6 +317,7 @@ export MKFS_BTRFS_PROG=$(set_mkfs_prog_path_with_opts btrfs) export MKFS_F2FS_PROG=$(set_mkfs_prog_path_with_opts f2fs) export DUMP_F2FS_PROG=$(type -P dump.f2fs) export F2FS_IO_PROG=$(type -P f2fs_io) +export F2FS_INJECT_PROG=$(type -P inject.f2fs) export BTRFS_UTIL_PROG=$(type -P btrfs) export BTRFS_SHOW_SUPER_PROG=$(type -P btrfs-show-super) export BTRFS_CONVERT_PROG=$(type -P btrfs-convert) From patchwork Thu Mar 6 08:18:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 14003978 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B27BB1DDC18 for ; Thu, 6 Mar 2025 08:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741249106; cv=none; b=aTQSqnfV4vablyUr2qYxrCqZJB0eAX2qheLVIP3QunVB1m1AlSis07tknz/cmqIPIlS401tOL4ZK1cdB+h/qi1t92fV0NhmExDWizQOiCYKBilquCzpaTeX+I/mixMQB3PrhniuQkpmnBKiRB1262AFhoHNT4z/rtQCUBFwrZ0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741249106; c=relaxed/simple; bh=97X0iTZrxA/2Izvuw1nyHZZXtS5Ddl1KNxKm5csh1Uo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UCFj2dEy1ekaN+0qWShwc0NkTm7xHqPww4ySKJBapwQO8omx9Jx+qK4xMscvQZSekLkCzKJjkcK0sxdWzUclhyubPYeFD8luncbmy4tvzzhWld/hDv+YzhZnBrKC43poIxBPHkaS3H7/EHqs9KqlEDAt5GFSxTybjORKTipaumU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ld7GnxgC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ld7GnxgC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03A14C4CEE4; Thu, 6 Mar 2025 08:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741249106; bh=97X0iTZrxA/2Izvuw1nyHZZXtS5Ddl1KNxKm5csh1Uo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ld7GnxgCCzksyPfDkq2XceIM47ieKhQDDLYbNMZOqtcwR5EzLWbIdMMvNneGlSds6 dRKHcbFsvEcMXMpd6QlzRZ+O1hozMilMaWU1cg1dnPltUP05775+azQtwFhoe92HaW 0R3Nnab8/oot74uynJTeHt1G9TkQWlFlrFWDeHz4F6KVf/o0T5i86prtomfYYadiwN gEvDKI6IYCGSzRLKm+pWNuzo6+rQqRXzkvSNsZ3eRSAepIaK83qDwmi59KJPfcX9lY mEzWKqG+eNZm/EdraDPCd0k7Ujau/VKKr4+dXPw9loKMyNBLOs6Veg8jaoMWE4WXuS +xFKcgrist/Ig== From: Chao Yu To: Zorro Lang , fstests@vger.kernel.org Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, Chao Yu Subject: [PATCH 3/4] common/rc: support f2fs in _repair_scratch_fs Date: Thu, 6 Mar 2025 16:18:08 +0800 Message-ID: <20250306081809.2397527-3-chao@kernel.org> X-Mailer: git-send-email 2.49.0.rc0.332.g42c0ae87b1-goog In-Reply-To: <20250306081809.2397527-1-chao@kernel.org> References: <20250306081809.2397527-1-chao@kernel.org> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Support f2fs in _repair_scratch_fs(), and use -f to repair the image forcely. Cc: Jaegeuk Kim Signed-off-by: Chao Yu Reviewed-by: David Disseldorp --- common/rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/rc b/common/rc index ca755055..bf24da4e 100644 --- a/common/rc +++ b/common/rc @@ -1500,6 +1500,9 @@ _repair_scratch_fs() # want the test to fail: _check_scratch_fs ;; + f2fs) + fsck -t $FSTYP -f $SCRATCH_DEV + ;; *) local dev=$SCRATCH_DEV local fstyp=$FSTYP From patchwork Thu Mar 6 08:18:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 14003979 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C4EED2E3386 for ; Thu, 6 Mar 2025 08:18:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741249108; cv=none; b=M39I+jqLv0Q1bEk706nJpO9RVyeQJ8onsmKosGURSXsVrN/1uA38nxh1k5PHOMVBkcF6O0/KE5zvZIu8Hnxw455TMxHgOGVYF2Jy7q0baBlPb9G80GDA3Gpdi3nrkKPG0u/7YKsmiKJt7QGyQAyR7h69fNiWM0020AkAsvhkFcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741249108; c=relaxed/simple; bh=kyXXro/OE6+H623m77kqlXTNMmRNhmQ9EpAFZfE9lXQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jSQzKohjSmhE5brnV5T1LZyv5f9X0f5p+bgbx/6Ov8yo8YnPby/znxSgwmJb+Zjf5iqz/Q68/FHfhiFunyYCeJdjuhAy49hp/ANkH21aYjcP08h1qlc443rGJFt91In9HRuUQjNR8G4ubciH1Dn2oiepyPHYVDYAOl8nqEAb60c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iJgO1Qml; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iJgO1Qml" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08786C4CEE9; Thu, 6 Mar 2025 08:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741249108; bh=kyXXro/OE6+H623m77kqlXTNMmRNhmQ9EpAFZfE9lXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJgO1Qmlv0WA1k0LdotT3Mi3qZAuvPVcSJKC5CYGJHKNPHcN05dLY6/VwnaOHpIBF 9AbLC9Ok4cvmDJhOZ0eFdYc68jzUs6CVHDVsJiiCtuXS7keh54eDn+cZgddROCOO0o OmaeN+wkT6YzHsne1CGa852e7eAS8Ch0yCNcrJukkqA18zb6IJv+qJvCiO1jpY+SgS Cvf3gFtyLwoXu2t63NAo8vJRRMrcdYgFLo5tfvaSdiFdSGb1QLuF38l7ZG39VeEVnL Skb/+7JN8BYm0WEqj2PiVdMTp7c8ZEcYb/7fBxHREHEcUVvivnqwGMGhhtWjuxpi0M bgVu+FgD4qOSw== From: Chao Yu To: Zorro Lang , fstests@vger.kernel.org Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, Chao Yu Subject: [PATCH 4/4] f2fs/009: detect and repair nlink corruption Date: Thu, 6 Mar 2025 16:18:09 +0800 Message-ID: <20250306081809.2397527-4-chao@kernel.org> X-Mailer: git-send-email 2.49.0.rc0.332.g42c0ae87b1-goog In-Reply-To: <20250306081809.2397527-1-chao@kernel.org> References: <20250306081809.2397527-1-chao@kernel.org> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is a regression test to check whether fsck can handle corrupted nlinks correctly, it uses inject.f2fs to inject nlinks w/ wrong value, and expects fsck.f2fs can detect such corruption and do the repair. Cc: Jaegeuk Kim Signed-off-by: Chao Yu --- tests/f2fs/009 | 142 +++++++++++++++++++++++++++++++++++++++++++++ tests/f2fs/009.out | 2 + 2 files changed, 144 insertions(+) create mode 100755 tests/f2fs/009 create mode 100644 tests/f2fs/009.out diff --git a/tests/f2fs/009 b/tests/f2fs/009 new file mode 100755 index 00000000..8f6a3e11 --- /dev/null +++ b/tests/f2fs/009 @@ -0,0 +1,142 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Chao Yu. All Rights Reserved. +# +# FS QA Test No. f2fs/009 +# +# This is a regression test to check whether fsck can handle corrupted +# nlinks correctly, it uses inject.f2fs to inject nlinks w/ wrong value, +# and expects fsck.f2fs can detect such corruption and do the repair. +# +. ./common/preamble +_begin_fstest auto quick + +_require_scratch + +dir=$SCRATCH_MNT +filename=$dir/foo +hardlink=$dir/bar + +for ((i=0;i<14;i++)) do + echo "round: " $i >> $seqres.full + + _scratch_mkfs "-f" >> $seqres.full + _scratch_mount >> $seqres.full + + if [ $i == 0 ]; then + touch $filename + ino=`stat $filename | awk '/Inode:/ {print $4}'` + nlink=0 + elif [ $i == 1 ]; then + mkdir $filename + ino=`stat $filename | awk '/Inode:/ {print $4}'` + nlink=1 + elif [ $i == 2 ]; then + mknod $filename c 9 0 + ino=`stat $filename | awk '/Inode:/ {print $4}'` + nlink=0 + elif [ $i == 3 ]; then + mknod $filename b 8 0 + ino=`stat $filename | awk '/Inode:/ {print $4}'` + nlink=0 + elif [ $i == 4 ]; then + mkfifo $filename + ino=`stat $filename | awk '/Inode:/ {print $4}'` + nlink=0 + elif [ $i == 5 ]; then + socket -s $filename >> $seqres.full 2>&1 & + pid=$! + sleep 2 + ino=`stat $filename | awk '/Inode:/ {print $4}'` + kill $pid >> $seqres.full 2>&1 + nlink=0 + elif [ $i == 6 ]; then + ln -s $dir/empty $filename + ino=`stat $filename | awk '/Inode:/ {print $4}'` + nlink=0 + elif [ $i == 7 ]; then + # orphan inode + touch $filename + ino=`stat $filename | awk '/Inode:/ {print $4}'` + $F2FS_IO_PROG write 1 0 1 zero atomic_commit $filename 5000 >> $seqres.full 2>&1 & + stat $filename >> $seqres.full + rm $filename + $F2FS_IO_PROG shutdown 1 $dir/ >> $seqres.full + sleep 6 + nlink=1 + elif [ $i == 8 ]; then + # hardlink on file + touch $filename + ino=`stat $filename | awk '/Inode:/ {print $4}'` + ln $filename $hardlink + nlink=0 + elif [ $i == 9 ]; then + # hardlink on charactor + mknod $filename c 9 0 + ino=`stat $filename | awk '/Inode:/ {print $4}'` + ln $filename $hardlink + nlink=0 + elif [ $i == 10 ]; then + # hardlink on blockdev + mknod $filename b 8 0 + ino=`stat $filename | awk '/Inode:/ {print $4}'` + ln $filename $hardlink + nlink=0 + elif [ $i == 11 ]; then + # hardlink on pipe + mkfifo $filename + ino=`stat $filename | awk '/Inode:/ {print $4}'` + ln $filename $hardlink + nlink=0 + elif [ $i == 12 ]; then + # hardlink on socket + socket -s $filename >> $seqres.full 2>&1 & + pid=$! + sleep 2 + ino=`stat $filename | awk '/Inode:/ {print $4}'` + kill $pid >> $seqres.full 2>&1 + ln $filename $hardlink + nlink=0 + elif [ $i == 13 ]; then + # hardlink on symlink + ln -s $dir/empty $filename + ino=`stat $filename | awk '/Inode:/ {print $4}'` + ln $filename $hardlink + nlink=0 + fi + + if [ $i != 7 ]; then + stat $dir/* >> $seqres.full + fi + echo "ino:"$ino >> $seqres.full + echo "nlink:"$nlink >> $seqres.full + + _scratch_unmount + + $F2FS_INJECT_PROG --node --mb i_links --nid $ino --val $nlink $SCRATCH_DEV >> $seqres.full + if [ $? != 0 ]; then + exit + fi + + export FSCK_OPTIONS="-f" + _repair_scratch_fs >> $seqres.full + if [ $? != 1 ]; then + _fail "fsck can not detect and repair zero nlink corruption "$i + exit + fi + + export FSCK_OPTIONS="" + _check_scratch_fs >> $seqres.full + if [ $? != 0 ]; then + _fail "fsck hasn't fixed nlink corruption "$i + exit + fi + + _scratch_mount >> $seqres.full + _scratch_unmount +done + +echo "Silence is golden" + +status=0 +exit diff --git a/tests/f2fs/009.out b/tests/f2fs/009.out new file mode 100644 index 00000000..7e977155 --- /dev/null +++ b/tests/f2fs/009.out @@ -0,0 +1,2 @@ +QA output created by 009 +Silence is golden