* Re: [PATCH] ext4, jbd2: ensure entering into panic after recording an error in JBD2 superblock
@ 2015-08-16 6:33 Daeho Jeong
0 siblings, 0 replies; 4+ messages in thread
From: Daeho Jeong @ 2015-08-16 6:33 UTC (permalink / raw)
To: Theodore Ts'o
Cc: 정대호, linux-ext4@vger.kernel.org,
daehojng@gmail.com
Sorry, I will re-check that patch and I'll execute xfstest from now.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ext4, jbd2: ensure entering into panic after recording an error in JBD2 superblock
@ 2015-08-10 5:44 Daeho Jeong
2015-08-15 15:20 ` Theodore Ts'o
0 siblings, 1 reply; 4+ messages in thread
From: Daeho Jeong @ 2015-08-10 5:44 UTC (permalink / raw)
To: tytso@mit.edu, linux-ext4@vger.kernel.org
Cc: daehojng@gmail.com, 정대호
If a EXT4 filesystem utilizes JBD2 journaling and an error occurs, the journaling
will be aborted first and the error number will be recorded into JBD2 superblock
and, finally, the system will enter into the panic state in "errors=panic" option.
But, in the rare case, this sequence is little twisted like the below figure and
it will happen that the system enters into panic state, which means the system
reset in mobile environment, before completion of recording an error in the
journal superblock. In this case, e2fsck cannot recognize that the filesystem
failure occured in the previous run and the corruption wouldn't be fixed.
Task A Task B
ext4_handle_error()
-> jbd2_journal_abort()
-> __journal_abort_soft()
-> __jbd2_journal_abort_hard()
| -> journal->j_flags |= JBD2_ABORT;
| __ext4_abort()
| -> jbd2_journal_abort()
| | -> __journal_abort_soft()
| | -> if (journal->j_flags & JBD2_ABORT)
| | return;
| -> panic()
-> jbd2_journal_update_sb_errno()
Tested-by: Hobin Woo <hobin.woo@samsung.com>
Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
Signed-off-by: Youngjin Gil <youngjin.gil@samsung.com>
---
fs/jbd2/journal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index b96bd80..b265fd8 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2051,10 +2051,10 @@ static void __journal_abort_soft (journal_t *journal, int errno)
if (!journal->j_errno)
journal->j_errno = errno;
- __jbd2_journal_abort_hard(journal);
-
if (errno)
jbd2_journal_update_sb_errno(journal);
+
+ __jbd2_journal_abort_hard(journal);
}
/**
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ext4, jbd2: ensure entering into panic after recording an error in JBD2 superblock
2015-08-10 5:44 Daeho Jeong
@ 2015-08-15 15:20 ` Theodore Ts'o
2015-08-15 18:05 ` Theodore Ts'o
0 siblings, 1 reply; 4+ messages in thread
From: Theodore Ts'o @ 2015-08-15 15:20 UTC (permalink / raw)
To: Daeho Jeong; +Cc: linux-ext4@vger.kernel.org, daehojng@gmail.com
On Mon, Aug 10, 2015 at 05:44:49AM +0000, Daeho Jeong wrote:
> If a EXT4 filesystem utilizes JBD2 journaling and an error occurs, the journaling
> will be aborted first and the error number will be recorded into JBD2 superblock
> and, finally, the system will enter into the panic state in "errors=panic" option.
> But, in the rare case, this sequence is little twisted like the below figure and
> it will happen that the system enters into panic state, which means the system
> reset in mobile environment, before completion of recording an error in the
> journal superblock. In this case, e2fsck cannot recognize that the filesystem
> failure occured in the previous run and the corruption wouldn't be fixed.
Applied, but please note that the patch was very badly whitespace
damaged, *despite* being base64 encoded. I had to manually apply the
patch. I also adjusted the commit description so that its width was
no more 80 columns (ideally the width should be no more than 72
columns wide).
Thanks,
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ext4, jbd2: ensure entering into panic after recording an error in JBD2 superblock
2015-08-15 15:20 ` Theodore Ts'o
@ 2015-08-15 18:05 ` Theodore Ts'o
0 siblings, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2015-08-15 18:05 UTC (permalink / raw)
To: Daeho Jeong; +Cc: linux-ext4@vger.kernel.org, daehojng@gmail.com
On Sat, Aug 15, 2015 at 11:20:36AM -0400, Theodore Ts'o wrote:
> On Mon, Aug 10, 2015 at 05:44:49AM +0000, Daeho Jeong wrote:
> > If a EXT4 filesystem utilizes JBD2 journaling and an error occurs, the journaling
> > will be aborted first and the error number will be recorded into JBD2 superblock
> > and, finally, the system will enter into the panic state in "errors=panic" option.
> > But, in the rare case, this sequence is little twisted like the below figure and
> > it will happen that the system enters into panic state, which means the system
> > reset in mobile environment, before completion of recording an error in the
> > journal superblock. In this case, e2fsck cannot recognize that the filesystem
> > failure occured in the previous run and the corruption wouldn't be fixed.
>
> Applied, but please note that the patch was very badly whitespace
> damaged, *despite* being base64 encoded. I had to manually apply the
> patch. I also adjusted the commit description so that its width was
> no more 80 columns (ideally the width should be no more than 72
> columns wide).
.... and this commit causes the kernel to wedge hard with xfstests
generic/081. So I'm going to drop this patch.
As I believe I mentioned before, please consider using xfstests as
part of your development work flow; it will save both you and me time.
Thanks,
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-16 6:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-16 6:33 [PATCH] ext4, jbd2: ensure entering into panic after recording an error in JBD2 superblock Daeho Jeong
-- strict thread matches above, loose matches on Subject: below --
2015-08-10 5:44 Daeho Jeong
2015-08-15 15:20 ` Theodore Ts'o
2015-08-15 18:05 ` 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).