lkml.org 
[lkml]   [2017]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 4.4 49/91] ext4: preserve the needs_recovery flag when the journal is aborted
    From
    Date
    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]
    \
     
     \ /
      Last update: 2017-03-10 17:59    [W:4.053 / U:0.180 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site