From 63c3d556fb1d9f4d51f0c135341f873557ab848b Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 24 Jun 1996 21:23:42 +0000 Subject: (diskfs_set_hypermetadata): If CLEAN is not set, make sure we clear the clean bit on disk. Always call sync_disk (with appropriate WAIT). (diskfs_readonly_changed): Don't do set_hypermetadata here. (copy_sblock): Don't track clean state here. --- ufs/hyper.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'ufs') diff --git a/ufs/hyper.c b/ufs/hyper.c index f198ff43..e4f58249 100644 --- a/ufs/hyper.c +++ b/ufs/hyper.c @@ -312,11 +312,20 @@ diskfs_set_hypermetadata (int wait, int clean) sblock->fs_clean = 1; sblock_dirty = 1; } + else if (!clean && sblock->fs_clean) + { + /* Clear the clean flag */ + sblock->fs_clean = 0; + sblock_dirty = 1; + wait = 1; /* must be synchronous */ + } spin_unlock (&alloclock); /* Update the superblock if necessary (clean bit was just set). */ copy_sblock (); + + sync_disk (wait); } /* Copy the sblock into the disk */ @@ -359,16 +368,6 @@ copy_sblock () sblock_dirty = 0; } - if (!diskfs_readonly && sblock->fs_clean) - { - /* We just sync'd with the clean flag set, but we are still a - writable filesystem. Clear the flag in core, but don't write the - superblock yet. This should ensure that the flag will be written - as clear as soon as we make any modifications. */ - sblock->fs_clean = 0; - sblock_dirty = 1; - } - spin_unlock (&alloclock); diskfs_end_catch_exception (); @@ -393,11 +392,6 @@ diskfs_readonly_changed (int readonly) strcpy (sblock->fs_fsmnt, "Hurd /"); /* XXX */ - if (sblock->fs_clean) - sblock->fs_clean = 0; - else + if (!sblock->fs_clean) error (0, 0, "WARNING: UNCLEANED FILESYSTEM NOW WRITABLE"); - - sblock_dirty = 1; - diskfs_set_hypermetadata (1, 0); } -- cgit v1.2.3