From mboxrd@z Thu Jan 1 00:00:00 1970 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 078B52D7D35 for ; Thu, 9 Oct 2025 09:08:53 +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=1760000934; cv=none; b=S4/9POAT6LVDIeDa8hXnnL2HE9XY6EvFD8SuKUCwe2Xtpdn/yNFgT2wUlk49AYmOlY6fuh34Vc9wXmCOv0jr2bHUB5QfWpqnyTxCIs4RH5TILtOgr8GwmGWh7ahQ4Yclg+DP3awQJnAT4mJbqvWSYuxoVITlwiyQ9bYl3VysSGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760000934; c=relaxed/simple; bh=7qX7dSyEVqUMvvtMzL7YjED76he7BdxUoYprgSlpf9Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nRlDOtfTlIkEgt1CbZUuK+QZ/C5hhWFp24Sv7ospbC15UdrPB8cYd+jQrXP0lQ9VAagi9XvLaU9drTU9lEBHGjT/JSSJ/mTPCzxDUwg6Lugjn1hbVjZvge2/5paOL4bpKIiGHQRyima2Rj3dhUflvPWVfucH0uiudZcdamqEz7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o7ehBCcI; 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="o7ehBCcI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15633C113D0; Thu, 9 Oct 2025 09:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760000933; bh=7qX7dSyEVqUMvvtMzL7YjED76he7BdxUoYprgSlpf9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o7ehBCcI9x2GyzJeYX8iDpERFl/6bOwZJ/WqEsN2ORa+kPGudRDmZpWgyESSafqzx u8NcItMtmH8vDASt39/hOQ4Ge25S24XvVxH5MbgsjNQLi3wRgAY8Ib99FxErpuE94p O00XY9pkz82QeAyRc2ppobj2CvBvjLxQ1Sd9Oidd/vMvRuwXtp802kPdltugqVMFkN kCYLw/TGyoSCzUcoZ0ScuUMtvx/vo5/WGKi97KWChf4yS2ad6LNdiZsYfRu01gwpvI a6KI/zosBE0zJgIfH5CMVdzIGFDduTVrHcESQzcfQFWwz/JnRqIbSpV5ep+Y6GOE1U rybByh3Xr+WIQ== 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/3] common/rc: move _check_f2fs_filesystem() to common/f2fs Date: Thu, 9 Oct 2025 16:50:42 +0800 Message-Id: <20251009085043.16910-2-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20251009085043.16910-1-chao@kernel.org> References: <20251009085043.16910-1-chao@kernel.org> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit _check_f2fs_filesystem() is f2fs specific, it's better to move it to common/f2fs. Cc: Jaegeuk Kim Signed-off-by: Chao Yu --- common/f2fs | 44 ++++++++++++++++++++++++++++++++++++++++++++ common/rc | 44 -------------------------------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/common/f2fs b/common/f2fs index 1b39d8ce..4d0d688b 100644 --- a/common/f2fs +++ b/common/f2fs @@ -25,3 +25,47 @@ _require_scratch_f2fs_compression() _scratch_unmount fi } + +_check_f2fs_filesystem() +{ + local device=$1 + + # If type is set, we're mounted + local type=`_fs_type $device` + local ok=1 + + if [ "$type" = "f2fs" ] + then + # mounted ... + local mountpoint=`_umount_or_remount_ro $device` + fi + + $F2FS_FSCK_PROG --dry-run $device >$tmp.fsck.f2fs 2>&1 + if [ $? -ne 0 ];then + _log_err "_check_f2fs_filesystem: filesystem on $device is inconsistent" + echo "*** fsck.f2fs output ***" >>$seqres.full + cat $tmp.fsck.f2fs >>$seqres.full + echo "*** end fsck.f2fs output" >>$seqres.full + + ok=0 + fi + rm -f $tmp.fsck.f2fs + + if [ $ok -eq 0 ] + then + echo "*** mount output ***" >>$seqres.full + _mount >>$seqres.full + echo "*** end mount output" >>$seqres.full + elif [ "$type" = "f2fs" ] + then + # was mounted ... + _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint + ok=$? + fi + + if [ $ok -eq 0 ]; then + return 1 + fi + + return 0 +} diff --git a/common/rc b/common/rc index 1ec84263..4d121a1b 100644 --- a/common/rc +++ b/common/rc @@ -3566,50 +3566,6 @@ _check_generic_filesystem() return 0 } -_check_f2fs_filesystem() -{ - local device=$1 - - # If type is set, we're mounted - local type=`_fs_type $device` - local ok=1 - - if [ "$type" = "f2fs" ] - then - # mounted ... - local mountpoint=`_umount_or_remount_ro $device` - fi - - $F2FS_FSCK_PROG --dry-run $device >$tmp.fsck.f2fs 2>&1 - if [ $? -ne 0 ];then - _log_err "_check_f2fs_filesystem: filesystem on $device is inconsistent" - echo "*** fsck.f2fs output ***" >>$seqres.full - cat $tmp.fsck.f2fs >>$seqres.full - echo "*** end fsck.f2fs output" >>$seqres.full - - ok=0 - fi - rm -f $tmp.fsck.f2fs - - if [ $ok -eq 0 ] - then - echo "*** mount output ***" >>$seqres.full - _mount >>$seqres.full - echo "*** end mount output" >>$seqres.full - elif [ "$type" = "f2fs" ] - then - # was mounted ... - _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint - ok=$? - fi - - if [ $ok -eq 0 ]; then - return 1 - fi - - return 0 -} - # Filter the knowen errors the UDF Verifier reports. _udf_test_known_error_filter() { -- 2.40.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94587CCD18A for ; Thu, 9 Oct 2025 09:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:To:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7mT0cUKMd2A3dMgQZbthN3GL9caBvvYPDwZuKIOE9mk=; b=fApujWZZbm7iNu7IMzBZYorI3Z OijFIkjqRNQ2IclR5uzerqUJPgpGWHbtOX5BfR1gaS5L3Wl2qCdyv+/59bjYvfn1sKe5bL/MVHShJ 8ZMVHhyYYutfyQWN9Y0tn+N+uEydmF/Mu64sweM1HS2DQZEaqdLSZZ5nTT/hVbi0lfVA=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v6me9-0006Ly-GG; Thu, 09 Oct 2025 09:09:14 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v6me0-0006LM-8c for linux-f2fs-devel@lists.sourceforge.net; Thu, 09 Oct 2025 09:09:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=i+fIgJTsbU5A5j9BLGd5/yHHkKgzK4Bwh50zzj7Gawo=; b=GLss3hGydRzC9/dqcU1iWzWuY2 LZfQYm2JS4EWll8c9rcWpsMF665Eo2agm1DhH3DttaYyCR6XoCLHEn318wm7gDx0/xbW1VFVV1oE2 xD92fkcx55twY3pWNDGSGgWSBUOTxcLqrAFUXbFaHJSeauwU0s38DYMbfau6aimWEUdc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=i+fIgJTsbU5A5j9BLGd5/yHHkKgzK4Bwh50zzj7Gawo=; b=lHMFLV/yMVtbR32cHLaQUwFqF4 1tSmCuxYF9CrJSaeFqzGJOSdYSVMA1x9pwGyj+//pnvrA+JijJiUTWdV1aXZ6VgtcFcillQXh9+D/ 9P0f3yH+YU3s6LNUdNEOjf1FLxNKBMjR5xhd+pJ+DBRLq+JYQJbINaXKhEYrajYLlaDM=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v6me0-0006G2-H2 for linux-f2fs-devel@lists.sourceforge.net; Thu, 09 Oct 2025 09:09:04 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id D8C356224C for ; Thu, 9 Oct 2025 09:08:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15633C113D0; Thu, 9 Oct 2025 09:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760000933; bh=7qX7dSyEVqUMvvtMzL7YjED76he7BdxUoYprgSlpf9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o7ehBCcI9x2GyzJeYX8iDpERFl/6bOwZJ/WqEsN2ORa+kPGudRDmZpWgyESSafqzx u8NcItMtmH8vDASt39/hOQ4Ge25S24XvVxH5MbgsjNQLi3wRgAY8Ib99FxErpuE94p O00XY9pkz82QeAyRc2ppobj2CvBvjLxQ1Sd9Oidd/vMvRuwXtp802kPdltugqVMFkN kCYLw/TGyoSCzUcoZ0ScuUMtvx/vo5/WGKi97KWChf4yS2ad6LNdiZsYfRu01gwpvI a6KI/zosBE0zJgIfH5CMVdzIGFDduTVrHcESQzcfQFWwz/JnRqIbSpV5ep+Y6GOE1U rybByh3Xr+WIQ== To: Zorro Lang , fstests@vger.kernel.org Date: Thu, 9 Oct 2025 16:50:42 +0800 Message-Id: <20251009085043.16910-2-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20251009085043.16910-1-chao@kernel.org> References: <20251009085043.16910-1-chao@kernel.org> MIME-Version: 1.0 X-Headers-End: 1v6me0-0006G2-H2 Subject: [f2fs-dev] [PATCH 2/3] common/rc: move _check_f2fs_filesystem() to common/f2fs X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Chao Yu via Linux-f2fs-devel Reply-To: Chao Yu Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net _check_f2fs_filesystem() is f2fs specific, it's better to move it to common/f2fs. Cc: Jaegeuk Kim Signed-off-by: Chao Yu --- common/f2fs | 44 ++++++++++++++++++++++++++++++++++++++++++++ common/rc | 44 -------------------------------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/common/f2fs b/common/f2fs index 1b39d8ce..4d0d688b 100644 --- a/common/f2fs +++ b/common/f2fs @@ -25,3 +25,47 @@ _require_scratch_f2fs_compression() _scratch_unmount fi } + +_check_f2fs_filesystem() +{ + local device=$1 + + # If type is set, we're mounted + local type=`_fs_type $device` + local ok=1 + + if [ "$type" = "f2fs" ] + then + # mounted ... + local mountpoint=`_umount_or_remount_ro $device` + fi + + $F2FS_FSCK_PROG --dry-run $device >$tmp.fsck.f2fs 2>&1 + if [ $? -ne 0 ];then + _log_err "_check_f2fs_filesystem: filesystem on $device is inconsistent" + echo "*** fsck.f2fs output ***" >>$seqres.full + cat $tmp.fsck.f2fs >>$seqres.full + echo "*** end fsck.f2fs output" >>$seqres.full + + ok=0 + fi + rm -f $tmp.fsck.f2fs + + if [ $ok -eq 0 ] + then + echo "*** mount output ***" >>$seqres.full + _mount >>$seqres.full + echo "*** end mount output" >>$seqres.full + elif [ "$type" = "f2fs" ] + then + # was mounted ... + _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint + ok=$? + fi + + if [ $ok -eq 0 ]; then + return 1 + fi + + return 0 +} diff --git a/common/rc b/common/rc index 1ec84263..4d121a1b 100644 --- a/common/rc +++ b/common/rc @@ -3566,50 +3566,6 @@ _check_generic_filesystem() return 0 } -_check_f2fs_filesystem() -{ - local device=$1 - - # If type is set, we're mounted - local type=`_fs_type $device` - local ok=1 - - if [ "$type" = "f2fs" ] - then - # mounted ... - local mountpoint=`_umount_or_remount_ro $device` - fi - - $F2FS_FSCK_PROG --dry-run $device >$tmp.fsck.f2fs 2>&1 - if [ $? -ne 0 ];then - _log_err "_check_f2fs_filesystem: filesystem on $device is inconsistent" - echo "*** fsck.f2fs output ***" >>$seqres.full - cat $tmp.fsck.f2fs >>$seqres.full - echo "*** end fsck.f2fs output" >>$seqres.full - - ok=0 - fi - rm -f $tmp.fsck.f2fs - - if [ $ok -eq 0 ] - then - echo "*** mount output ***" >>$seqres.full - _mount >>$seqres.full - echo "*** end mount output" >>$seqres.full - elif [ "$type" = "f2fs" ] - then - # was mounted ... - _mount_or_remount_rw "$MOUNT_OPTIONS" $device $mountpoint - ok=$? - fi - - if [ $ok -eq 0 ]; then - return 1 - fi - - return 0 -} - # Filter the knowen errors the UDF Verifier reports. _udf_test_known_error_filter() { -- 2.40.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel