From nobody Wed Jul 26 02:44:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R9dWt4XB5z4pJBF; Wed, 26 Jul 2023 02:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R9dWt407Qz3xqB; Wed, 26 Jul 2023 02:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690339450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QlCZtx6cfPQve8xaLaY765tiBCfQGWhvko6ehmLMKRk=; b=qE+CTaWPNbihVtB3J67YjzQtdkpf/vtj2Erwc95lNLu9UfTYtzsKJDJRNcxoJdRbZD5yxw /UyGELrpHgHIxhDjIHn++ZP0pIvBhJyAAEmqKmAgXubD1nrOxNj8L4dX+XE3IXDq56/YCT bKhXX/vuvAgIjFEJRbyji+Pmvhxh+aMmzwVnwOtttOXhKiYL0XOAPUBiGGuZVK5nr0MuVN a4AeYwrGiuDKhuXgOsIPabCJVvUfVwlsICVNTSr9IhLgedKGrvpXFxGGcjMN31n0mxngRl gZn9w8xknLihG0XZ3/i3AJ/tgLiCiadUqU0AHYIYQZyDKGRnwckdvkqr9fuYqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690339450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QlCZtx6cfPQve8xaLaY765tiBCfQGWhvko6ehmLMKRk=; b=o8+4e1OZRBrGIQ1KDXCo9w9E7YrUHDtUO45ibRuMp60w75FbRXBzBGUTFakJvAMaoh1mR3 BAy2Q8ffhSK3IS33nZlH0Axn87iWgGzZ6DKimC37tGYOiSzD4MM41V9JNOYGa2O5nw8Ai0 Vh2YMFg+oei2rFmv5negc6BWoo4gJtbY8DChmTAzj2JQIfL5MIiQNgUakjsgfdzV0Q/lCt YvoHGyfzDdR4ilzqy6Ii8fqb8wGQrod7Sa+Cb0qy0CiC/wIABR7HU2gIdWiET3M2KFF9LD 0WTxaLuvqT3kG7yn0jGt4bPDpimmPYnfR8NiMOPChaaFDdJYe4m2WoDWrgMobw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690339450; a=rsa-sha256; cv=none; b=hds/Wwh5m3gZg6xo/k/KpDDmZ1qAaMmKQYwQfryUVPIdePib7h56itvZcepTiMO066w/k6 fyt3Vi9REuT1zQAvLt7rWMscbTK6UMC+Bl9uXzcnRoGNSMsKmDQw0GsPNiA4xwGnkxboRa T4e2X5DrnRbtkBg5OP409pGfNKLXvJMU15PtgmtevgdYzsHmJbvYtgjXfTno/UXfVi2jQv Z2ttgqpwmbedKgb00pL8M1bbv1RhPjavhGzc+nGLsjdNRbwWyezbjMLzClN5Xm8Rp6EV/3 VMAaIGNUgKpOLhjVhx2d4x0oxuSv0XAvnkDY5kIJmnZvtYJnQmv3PSNBIPlTaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R9dWt2kC4zQvP; Wed, 26 Jul 2023 02:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36Q2iAIp058860; Wed, 26 Jul 2023 02:44:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36Q2iALv058859; Wed, 26 Jul 2023 02:44:10 GMT (envelope-from git) Date: Wed, 26 Jul 2023 02:44:10 GMT Message-Id: <202307260244.36Q2iALv058859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: d059e44b800a - main - Add quitclean command to fsdb(8) to request a filesystem not be marked dirty. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d059e44b800a308822ad920c28f948a1afcc0fa3 Auto-Submitted: auto-generated The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=d059e44b800a308822ad920c28f948a1afcc0fa3 commit d059e44b800a308822ad920c28f948a1afcc0fa3 Author: Kirk McKusick AuthorDate: 2023-07-26 02:42:41 +0000 Commit: Kirk McKusick CommitDate: 2023-07-26 02:42:41 +0000 Add quitclean command to fsdb(8) to request a filesystem not be marked dirty. A new command, quitclean, is added to fsdb(8) to request that the filesystem not be marked as needing a full fsck(8). This is useful when creating deliberately bad filesystem images to be used to check that fsck is properly able to clean them up. MFC-after: 1 week Sponsored-by: The FreeBSD Foundation --- sbin/fsdb/fsdb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c index ceb4a884e885..2d8c75cce5fe 100644 --- a/sbin/fsdb/fsdb.c +++ b/sbin/fsdb/fsdb.c @@ -163,6 +163,7 @@ CMDFUNC(uplink); /* incr link */ CMDFUNC(downlink); /* decr link */ CMDFUNC(linkcount); /* set link count */ CMDFUNC(quit); /* quit */ +CMDFUNC(quitclean); /* quit with filesystem marked clean */ CMDFUNC(findblk); /* find block */ CMDFUNC(ls); /* list directory */ CMDFUNC(rm); /* remove name */ @@ -217,6 +218,7 @@ struct cmdtable cmds[] = { { "ctime", "Change ctime of current inode to CTIME", 2, 2, FL_WR, chctime }, { "atime", "Change atime of current inode to ATIME", 2, 2, FL_WR, chatime }, { "chdb", "Change db pointer N of current inode to BLKNO", 3, 3, FL_CWR, chdb }, + { "quitclean", "Exit with filesystem marked clean", 1, 1, FL_RO, quitclean }, { "quit", "Exit", 1, 1, FL_RO, quit }, { "q", "Exit", 1, 1, FL_RO, quit }, { "exit", "Exit", 1, 1, FL_RO, quit }, @@ -402,6 +404,16 @@ CMDFUNCSTART(quit) return -1; } +CMDFUNCSTART(quitclean) +{ + if (fscritmodified) { + printf("Warning: modified filesystem marked clean\n"); + fscritmodified = 0; + sblock.fs_clean = 1; + } + return -1; +} + CMDFUNCSTART(uplink) { if (!checkactive())