Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Aug 2023 06:21:23 GMT
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 98b660abffac - stable/13 - Add quitclean command to fsdb(8) to request a filesystem not be marked dirty.
Message-ID:  <202308050621.3756LNOt024517@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mckusick:

URL: https://cgit.FreeBSD.org/src/commit/?id=98b660abffacc3caa36f59b7eb62955a5f5e151b

commit 98b660abffacc3caa36f59b7eb62955a5f5e151b
Author:     Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2023-07-26 02:42:41 +0000
Commit:     Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2023-08-05 06:20:25 +0000

    Add quitclean command to fsdb(8) to request a filesystem not be marked dirty.
    
    Sponsored-by: The FreeBSD Foundation
    (cherry picked from commit d059e44b800a308822ad920c28f948a1afcc0fa3)
---
 sbin/fsdb/fsdb.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index c80d4b65a830..1564810ee79d 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())



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308050621.3756LNOt024517>