Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Mar 2021 23:36:00 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0dcde5cc1274 - main - growfs: allow operation on RW-mounted filesystems
Message-ID:  <202103032336.123Na06i010967@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=0dcde5cc12744e5188300711a8829e5e6a9cd0de

commit 0dcde5cc12744e5188300711a8829e5e6a9cd0de
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2021-03-02 22:35:48 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2021-03-03 23:35:21 +0000

    growfs: allow operation on RW-mounted filesystems
    
    growfs supports growing mounted filesystems (writes are temporarily
    suspended while the grow happens).  Drop the check for fs_clean == 0
    to restore this case.  Leave fs_flags check for FS_UNCLEAN or
    FS_NEEDSFSCK which represent the state of the filesystem when it was
    mounted, and fsck should be run first if they are set.
    
    PR:             253754
    Reviewed by:    mckusick
    MFC after:      3 days
    Fixes:          6eb925f8450f ("Filesystem utilities that modify the...")
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D29021
---
 sbin/growfs/growfs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index d1098210f088..510192dada0b 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -1461,10 +1461,9 @@ main(int argc, char **argv)
 		}
 	}
 	/*
-	 * Check for unclean filesystem.
+	 * Check for filesystem that was unclean at mount time.
 	 */
-	if (fs->fs_clean == 0 ||
-	    (fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0)
+	if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0)
 		errx(1, "%s is not clean - run fsck.\n", *argv);
 	memcpy(&osblock, fs, fs->fs_sbsize);
 	free(fs);



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