summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext2fs/hyper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c
index 627b1ac6..2a940308 100644
--- a/ext2fs/hyper.c
+++ b/ext2fs/hyper.c
@@ -199,6 +199,9 @@ diskfs_set_hypermetadata (int wait, int clean)
if (sblock_dirty)
{
+ if (diskfs_readonly)
+ return EROFS; /* impossible to write */
+
/* Before writing, set the time of write */
sblock->s_wtime = htole32 (diskfs_mtime->seconds);
sblock_dirty = 0;
@@ -209,7 +212,6 @@ diskfs_set_hypermetadata (int wait, int clean)
sync_global (wait);
- /* Should check writability here and return EROFS if necessary. XXX */
return 0;
}