linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: Ritesh Harjani <riteshh@linux.ibm.com>
Cc: linux-ext4@vger.kernel.org, xu.xin16@zte.com.cn
Subject: Re: [PATCH] ext4: Simplify !page_bufs logic with simple BUG_ON()
Date: Wed, 5 Jan 2022 09:45:09 +0100	[thread overview]
Message-ID: <20220105084509.d7gptudqulyjvhiq@work> (raw)
In-Reply-To: <4088b190f4367763c447f22e39ecb35de324f19e.1641371169.git.riteshh@linux.ibm.com>

On Wed, Jan 05, 2022 at 02:06:56PM +0530, Ritesh Harjani wrote:
> Simplify !page_bufs logic with simple BUG_ON().

Looks good, thanks!

Reviewed-by: Lukas Czerner <lczerner@redhat.com>

> 
> Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
> ---
> Noticed a bug_on() related patch while reviewing, hence felt, this
> below trivial change could be included along with it.
> 
>  fs/ext4/inode.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index bfd3545f1e5d..5656b4a9007b 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -1879,10 +1879,7 @@ static int __ext4_journalled_writepage(struct page *page,
>  			goto out;
>  	} else {
>  		page_bufs = page_buffers(page);
> -		if (!page_bufs) {
> -			BUG();
> -			goto out;
> -		}
> +		BUG_ON(!page_bufs);
>  		ext4_walk_page_buffers(handle, inode, page_bufs, 0, len,
>  				       NULL, bget_one);
>  	}
> --
> 2.31.1
> 


  reply	other threads:[~2022-01-05  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-19 13:06 [PATCH linux-next] fs/ext4: use BUG_ON instead of if condition followed by BUG cgel.zte
2021-12-20 10:24 ` Lukas Czerner
2021-12-28  7:32   ` [PATCH resend] " cgel.zte
2022-01-05  5:35     ` riteshh
2022-01-05  6:22       ` cgel.zte
2022-01-05  8:36     ` [PATCH] ext4: Simplify !page_bufs logic with simple BUG_ON() Ritesh Harjani
2022-01-05  8:45       ` Lukas Czerner [this message]
2022-01-06  4:37       ` Theodore Ts'o
2022-01-06  4:41     ` [PATCH resend] fs/ext4: use BUG_ON instead of if condition followed by BUG Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220105084509.d7gptudqulyjvhiq@work \
    --to=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=riteshh@linux.ibm.com \
    --cc=xu.xin16@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).