summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-09-22 23:57:06 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-09-22 23:57:06 +0200
commit8da984cc1e47b2bb7ff6361a81b59593a51a3513 (patch)
tree91ff7842ff7aef1809c74efb1b8d56d086f3c03a /libdiskfs
parentea9d181f270aa903a2f31d2d00deb18c1be9792e (diff)
Set diskfs stores as readonly on shutdown before enabling RPCs again.
* libdiskfs/init-startup.c (diskfs_S_startup_dosync): Set diskfs as read-only on shutdown.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/init-startup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libdiskfs/init-startup.c b/libdiskfs/init-startup.c
index bf1acf29..ff57db38 100644
--- a/libdiskfs/init-startup.c
+++ b/libdiskfs/init-startup.c
@@ -148,6 +148,13 @@ diskfs_S_startup_dosync (mach_port_t handle)
diskfs_set_hypermetadata (1, 1);
_diskfs_diskdirty = 0;
+ /* XXX: if some application writes something after that, we will
+ * crash. That is still better than creating pending writes before
+ * poweroff, and thus fsck on next reboot.
+ */
+ diskfs_readonly = 1;
+ diskfs_readonly_changed (1);
+
ports_resume_class_rpcs (diskfs_protid_class);
}