All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani <riteshh@linux.ibm.com>
To: linux-ext4@vger.kernel.org
Cc: xu.xin16@zte.com.cn, Ritesh Harjani <riteshh@linux.ibm.com>
Subject: [PATCH] ext4: Simplify !page_bufs logic with simple BUG_ON()
Date: Wed,  5 Jan 2022 14:06:56 +0530	[thread overview]
Message-ID: <4088b190f4367763c447f22e39ecb35de324f19e.1641371169.git.riteshh@linux.ibm.com> (raw)
In-Reply-To: <20211228073252.580296-1-xu.xin16@zte.com.cn>

Simplify !page_bufs logic with simple BUG_ON().

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


  parent reply	other threads:[~2022-01-05  8:37 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     ` Ritesh Harjani [this message]
2022-01-05  8:45       ` [PATCH] ext4: Simplify !page_bufs logic with simple BUG_ON() Lukas Czerner
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=4088b190f4367763c447f22e39ecb35de324f19e.1641371169.git.riteshh@linux.ibm.com \
    --to=riteshh@linux.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.