summaryrefslogtreecommitdiff
path: root/ufs/hyper.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-24 21:23:42 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-24 21:23:42 +0000
commit63c3d556fb1d9f4d51f0c135341f873557ab848b (patch)
tree7084504ba064466b47076334eca2f4f5394532f2 /ufs/hyper.c
parent598aacf96d6739bb594123fb1a34b070c236660e (diff)
(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.
Diffstat (limited to 'ufs/hyper.c')
-rw-r--r--ufs/hyper.c26
1 files changed, 10 insertions, 16 deletions
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);
}