Messages in this thread | | | Subject | Re: [PATCH 4.4 49/91] ext4: preserve the needs_recovery flag when the journal is aborted | From | Ben Hutchings <> | Date | Fri, 10 Mar 2017 16:58:02 +0000 |
| |
On Fri, 2017-03-10 at 10:08 +0100, Greg Kroah-Hartman wrote: > 4.4-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > From: Theodore Ts'o <tytso@mit.edu> > > commit 97abd7d4b5d9c48ec15c425485f054e1c15e591b upstream. > > If the journal is aborted, the needs_recovery feature flag should not > be removed. Otherwise, it's the journal might not get replayed and > this could lead to more data getting lost. > > Signed-off-by: Theodore Ts'o <tytso@mit.edu> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > --- > fs/ext4/super.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c [...] > @@ -802,9 +803,10 @@ static void ext4_put_super(struct super_ > destroy_workqueue(sbi->rsv_conversion_wq); > > if (sbi->s_journal) { > + aborted = is_journal_aborted(sbi->s_journal); > err = jbd2_journal_destroy(sbi->s_journal); > sbi->s_journal = NULL; > - if (err < 0) > + if ((err < 0) && !aborted) > ext4_abort(sb, "Couldn't clean up the journal"); [...]
Shouldn't the aborted flag also be set here when err < 0?
Ben.
-- Ben Hutchings If you seem to know what you are doing, you'll be given more to do.
[unhandled content-type:application/pgp-signature] | |