linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC PATCH] jbd2: no need to repeat in jbd2_journal_add_journal_head
       [not found] <20200129095700.3043-1-fishland@aliyun.com>
@ 2020-01-29 16:20 ` Jan Kara
  0 siblings, 0 replies; only message in thread
From: Jan Kara @ 2020-01-29 16:20 UTC (permalink / raw)
  To: Liu Song; +Cc: tytso, jack, linux-ext4, linux-kernel, liu.song11

On Wed 29-01-20 17:57:00, Liu Song wrote:
> From: Liu Song <liu.song11@zte.com.cn>
> 
> In "journal_alloc_journal_head" use "GFP_NOFS | __GFP_NOFAIL"
> as the alloc flag, so it will retry until memory allocation
> is successful. Then we do not need to do extra repeat.
> 
> Signed-off-by: Liu Song <liu.song11@zte.com.cn>

Thanks for the patch. It looks good. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/jbd2/journal.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index 5e408ee24a1a..1a9aaf07cecd 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -2503,7 +2503,6 @@ struct journal_head *jbd2_journal_add_journal_head(struct buffer_head *bh)
>  	struct journal_head *jh;
>  	struct journal_head *new_jh = NULL;
>  
> -repeat:
>  	if (!buffer_jbd(bh))
>  		new_jh = journal_alloc_journal_head();
>  
> @@ -2515,11 +2514,6 @@ struct journal_head *jbd2_journal_add_journal_head(struct buffer_head *bh)
>  			(atomic_read(&bh->b_count) > 0) ||
>  			(bh->b_page && bh->b_page->mapping));
>  
> -		if (!new_jh) {
> -			jbd_unlock_bh_journal_head(bh);
> -			goto repeat;
> -		}
> -
>  		jh = new_jh;
>  		new_jh = NULL;		/* We consumed it */
>  		set_buffer_jbd(bh);
> -- 
> 2.20.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-29 16:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200129095700.3043-1-fishland@aliyun.com>
2020-01-29 16:20 ` [RFC PATCH] jbd2: no need to repeat in jbd2_journal_add_journal_head Jan Kara

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).