diff --git a/sbin/fsck/pass5.c b/sbin/fsck/pass5.c index eae5d7eda1c..a6ed6a1b39d 100644 --- a/sbin/fsck/pass5.c +++ b/sbin/fsck/pass5.c @@ -315,9 +315,17 @@ pass5() && dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) { bcopy((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs); fs->fs_ronly = 0; - fs->fs_fmod = 0; sbdirty(); } + if (fs->fs_fmod != 0) { + pwarn("MODIFIED FLAG SET IN SUPERBLOCK"); + if (preen) + printf(" (FIXED)\n"); + if (preen || reply("FIX") == 1) { + fs->fs_fmod = 0; + sbdirty(); + } + } if (fs->fs_clean == 0) { pwarn("CLEAN FLAG NOT SET IN SUPERBLOCK"); if (preen) diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index eae5d7eda1c..a6ed6a1b39d 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -315,9 +315,17 @@ pass5() && dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) { bcopy((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs); fs->fs_ronly = 0; - fs->fs_fmod = 0; sbdirty(); } + if (fs->fs_fmod != 0) { + pwarn("MODIFIED FLAG SET IN SUPERBLOCK"); + if (preen) + printf(" (FIXED)\n"); + if (preen || reply("FIX") == 1) { + fs->fs_fmod = 0; + sbdirty(); + } + } if (fs->fs_clean == 0) { pwarn("CLEAN FLAG NOT SET IN SUPERBLOCK"); if (preen) diff --git a/sbin/fsck_ifs/pass5.c b/sbin/fsck_ifs/pass5.c index eae5d7eda1c..a6ed6a1b39d 100644 --- a/sbin/fsck_ifs/pass5.c +++ b/sbin/fsck_ifs/pass5.c @@ -315,9 +315,17 @@ pass5() && dofix(&idesc[0], "FREE BLK COUNT(S) WRONG IN SUPERBLK")) { bcopy((char *)&cstotal, (char *)&fs->fs_cstotal, sizeof *cs); fs->fs_ronly = 0; - fs->fs_fmod = 0; sbdirty(); } + if (fs->fs_fmod != 0) { + pwarn("MODIFIED FLAG SET IN SUPERBLOCK"); + if (preen) + printf(" (FIXED)\n"); + if (preen || reply("FIX") == 1) { + fs->fs_fmod = 0; + sbdirty(); + } + } if (fs->fs_clean == 0) { pwarn("CLEAN FLAG NOT SET IN SUPERBLOCK"); if (preen)