summaryrefslogtreecommitdiffstats
path: root/sbin/tunefs/tunefs.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2001-04-13 23:54:49 +0000
committermckusick <mckusick@FreeBSD.org>2001-04-13 23:54:49 +0000
commit4cf28ecf05489a0643d696f8448554c41731c3ee (patch)
treea45cba5dd23489c744e50d4109284209a706e5a8 /sbin/tunefs/tunefs.c
parent9c4024b5eda0b717c792ff9c1f7a25558350660a (diff)
downloadFreeBSD-src-4cf28ecf05489a0643d696f8448554c41731c3ee.zip
FreeBSD-src-4cf28ecf05489a0643d696f8448554c41731c3ee.tar.gz
Do not allow the soft updates flag to be set if the filesystem is dirty.
Because the kernel will allow the mounting of unclean filesystems when the soft updates flag is set, it is important that only soft updates style inconsistencies (missing blocks and inodes) be present. Otherwise a panic may ensue. It is also important that the filesystem be in a clean state when the soft updates flag is set because the background fsck uses the fact that the flag is set to indicate that it is safe to run. If background fsck encounters non-soft updates style inconsistencies, it will exit with unexpected inconsistencies.
Diffstat (limited to 'sbin/tunefs/tunefs.c')
-rw-r--r--sbin/tunefs/tunefs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index 1fda3f7..e694e2f 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -285,8 +285,11 @@ again:
if (nflag) {
name = "soft updates";
if (strcmp(nvalue, "enable") == 0) {
- if ( sblock.fs_flags & FS_DOSOFTDEP ) {
+ if (sblock.fs_flags & FS_DOSOFTDEP) {
warnx("%s remains unchanged as enabled", name);
+ } else if (sblock.fs_clean == 0) {
+ warnx("%s cannot be enabled until fsck is run",
+ name);
} else {
sblock.fs_flags |= FS_DOSOFTDEP;
warnx("%s set", name);
OpenPOWER on IntegriCloud