* [PATCH] ext4: short-cut orphan cleanup on error
@ 2016-07-09 22:50 Vegard Nossum
2016-07-15 3:49 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Vegard Nossum @ 2016-07-09 22:50 UTC (permalink / raw)
To: tytso; +Cc: linux-ext4, Vegard Nossum, Jan Kara
If we encounter a filesystem error during orphan cleanup, we should stop.
Otherwise, we may end up in an infinite loop where the same inode is
processed again and again.
EXT4-fs (loop0): warning: checktime reached, running e2fsck is recommended
EXT4-fs error (device loop0): ext4_mb_generate_buddy:758: group 2, block bitmap and bg descriptor inconsistent: 6117 vs 0 free clusters
Aborting journal on device loop0-8.
EXT4-fs (loop0): Remounting filesystem read-only
EXT4-fs error (device loop0) in ext4_free_blocks:4895: Journal has aborted
EXT4-fs error (device loop0) in ext4_do_update_inode:4893: Journal has aborted
EXT4-fs error (device loop0) in ext4_do_update_inode:4893: Journal has aborted
EXT4-fs error (device loop0) in ext4_ext_remove_space:3068: IO failure
EXT4-fs error (device loop0) in ext4_ext_truncate:4667: Journal has aborted
EXT4-fs error (device loop0) in ext4_orphan_del:2927: Journal has aborted
EXT4-fs error (device loop0) in ext4_do_update_inode:4893: Journal has aborted
EXT4-fs (loop0): Inode 16 (00000000618192a0): orphan list check failed!
[...]
EXT4-fs (loop0): Inode 16 (0000000061819748): orphan list check failed!
[...]
EXT4-fs (loop0): Inode 16 (0000000061819bf0): orphan list check failed!
[...]
See-also: c9eb13a9105 ("ext4: fix hang when processing corrupted orphaned inode list")
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
fs/ext4/super.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 05ec0a7..b92802d 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2284,6 +2284,16 @@ static void ext4_orphan_cleanup(struct super_block *sb,
while (es->s_last_orphan) {
struct inode *inode;
+ /*
+ * We may have encountered an error during cleanup; if
+ * so, skip the rest.
+ */
+ if (EXT4_SB(sb)->s_mount_state & EXT4_ERROR_FS) {
+ jbd_debug(1, "Skipping orphan recovery on fs with errors.\n");
+ es->s_last_orphan = 0;
+ break;
+ }
+
inode = ext4_orphan_get(sb, le32_to_cpu(es->s_last_orphan));
if (IS_ERR(inode)) {
es->s_last_orphan = 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: short-cut orphan cleanup on error
2016-07-09 22:50 [PATCH] ext4: short-cut orphan cleanup on error Vegard Nossum
@ 2016-07-15 3:49 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2016-07-15 3:49 UTC (permalink / raw)
To: Vegard Nossum; +Cc: linux-ext4, Jan Kara
On Sun, Jul 10, 2016 at 12:50:04AM +0200, Vegard Nossum wrote:
> If we encounter a filesystem error during orphan cleanup, we should stop.
> Otherwise, we may end up in an infinite loop where the same inode is
> processed again and again.
>
> EXT4-fs (loop0): warning: checktime reached, running e2fsck is recommended
> EXT4-fs error (device loop0): ext4_mb_generate_buddy:758: group 2, block bitmap and bg descriptor inconsistent: 6117 vs 0 free clusters
> Aborting journal on device loop0-8.
> EXT4-fs (loop0): Remounting filesystem read-only
> EXT4-fs error (device loop0) in ext4_free_blocks:4895: Journal has aborted
> EXT4-fs error (device loop0) in ext4_do_update_inode:4893: Journal has aborted
> EXT4-fs error (device loop0) in ext4_do_update_inode:4893: Journal has aborted
> EXT4-fs error (device loop0) in ext4_ext_remove_space:3068: IO failure
> EXT4-fs error (device loop0) in ext4_ext_truncate:4667: Journal has aborted
> EXT4-fs error (device loop0) in ext4_orphan_del:2927: Journal has aborted
> EXT4-fs error (device loop0) in ext4_do_update_inode:4893: Journal has aborted
> EXT4-fs (loop0): Inode 16 (00000000618192a0): orphan list check failed!
> [...]
> EXT4-fs (loop0): Inode 16 (0000000061819748): orphan list check failed!
> [...]
> EXT4-fs (loop0): Inode 16 (0000000061819bf0): orphan list check failed!
> [...]
>
> See-also: c9eb13a9105 ("ext4: fix hang when processing corrupted orphaned inode list")
> Cc: Jan Kara <jack@suse.cz>
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Applied, thanks.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-15 3:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-09 22:50 [PATCH] ext4: short-cut orphan cleanup on error Vegard Nossum
2016-07-15 3:49 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).