diff options
-rw-r--r-- | fs/ext3/super.c | 6 | ||||
-rw-r--r-- | fs/ext4/super.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 8ab198133357..580b8a6ca979 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -1264,6 +1264,12 @@ static void ext3_orphan_cleanup (struct super_block * sb, | |||
1264 | return; | 1264 | return; |
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | if (bdev_read_only(sb->s_bdev)) { | ||
1268 | printk(KERN_ERR "EXT3-fs: write access " | ||
1269 | "unavailable, skipping orphan cleanup.\n"); | ||
1270 | return; | ||
1271 | } | ||
1272 | |||
1267 | if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { | 1273 | if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) { |
1268 | if (es->s_last_orphan) | 1274 | if (es->s_last_orphan) |
1269 | jbd_debug(1, "Errors on filesystem, " | 1275 | jbd_debug(1, "Errors on filesystem, " |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 2ede7e2c7019..486a641ca71b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1321,6 +1321,12 @@ static void ext4_orphan_cleanup (struct super_block * sb, | |||
1321 | return; | 1321 | return; |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | if (bdev_read_only(sb->s_bdev)) { | ||
1325 | printk(KERN_ERR "EXT4-fs: write access " | ||
1326 | "unavailable, skipping orphan cleanup.\n"); | ||
1327 | return; | ||
1328 | } | ||
1329 | |||
1324 | if (EXT4_SB(sb)->s_mount_state & EXT4_ERROR_FS) { | 1330 | if (EXT4_SB(sb)->s_mount_state & EXT4_ERROR_FS) { |
1325 | if (es->s_last_orphan) | 1331 | if (es->s_last_orphan) |
1326 | jbd_debug(1, "Errors on filesystem, " | 1332 | jbd_debug(1, "Errors on filesystem, " |