Filesystem utilities that modify the filesystem (growfs(8), tunefs(8),
and fsirand(8)) should check the filesystem status and require that fsck(8) be run if it is unclean. This requirement is not imposed on fsdb(8) or clri(8) since they may be used to clean up a filesystem. MFC after: 2 weeks Sponsored by: Netflix
This commit is contained in:
@@ -1460,6 +1460,12 @@ main(int argc, char **argv)
|
||||
errc(1, ret, "unable to read superblock");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Check for unclean filesystem.
|
||||
*/
|
||||
if (fs->fs_clean == 0 ||
|
||||
(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);
|
||||
memcpy((void *)&fsun1, (void *)&fsun2, osblock.fs_sbsize);
|
||||
|
||||
Reference in New Issue
Block a user