Re: [PATCH 4.4 49/91] ext4: preserve the needs_recovery flag when the journal is aborted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> 
> 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@xxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> 
> ---
>  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.

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]