summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext3/super.c6
-rw-r--r--fs/ext4/super.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 8ab19813335..580b8a6ca97 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -1264,6 +1264,12 @@ static void ext3_orphan_cleanup (struct super_block * sb,
return;
}
+ if (bdev_read_only(sb->s_bdev)) {
+ printk(KERN_ERR "EXT3-fs: write access "
+ "unavailable, skipping orphan cleanup.\n");
+ return;
+ }
+
if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) {
if (es->s_last_orphan)
jbd_debug(1, "Errors on filesystem, "
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2ede7e2c701..486a641ca71 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1321,6 +1321,12 @@ static void ext4_orphan_cleanup (struct super_block * sb,
return;
}
+ if (bdev_read_only(sb->s_bdev)) {
+ printk(KERN_ERR "EXT4-fs: write access "
+ "unavailable, skipping orphan cleanup.\n");
+ return;
+ }
+
if (EXT4_SB(sb)->s_mount_state & EXT4_ERROR_FS) {
if (es->s_last_orphan)
jbd_debug(1, "Errors on filesystem, "