linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bean Huo <beanhuo@iokpp.de>
To: viro@zeniv.linux.org.uk, brauner@kernel.org,
	akpm@linux-foundation.org, jack@suse.cz, jack@suse.com,
	tytso@mit.edu, adilger.kernel@dilger.ca, mark@fasheh.com,
	jlbec@evilplan.org, joseph.qi@linux.alibaba.com
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	beanhuo@micron.com
Subject: [PATCH v2 2/5] ext4: No need to check return value of block_commit_write()
Date: Mon, 19 Jun 2023 23:18:24 +0200	[thread overview]
Message-ID: <20230619211827.707054-3-beanhuo@iokpp.de> (raw)
In-Reply-To: <20230619211827.707054-1-beanhuo@iokpp.de>

From: Bean Huo <beanhuo@micron.com>

Remove unnecessary check on the return value of block_commit_write(),
because it always returns 0.

Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/move_extent.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index b5af2fc03b2f..f4b4861a74ee 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -392,14 +392,11 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
 	for (i = 0; i < block_len_in_page; i++) {
 		*err = ext4_get_block(orig_inode, orig_blk_offset + i, bh, 0);
 		if (*err < 0)
-			break;
+			goto repair_branches;
 		bh = bh->b_this_page;
 	}
-	if (!*err)
-		*err = block_commit_write(&folio[0]->page, from, from + replaced_size);
 
-	if (unlikely(*err < 0))
-		goto repair_branches;
+	block_commit_write(&folio[0]->page, from, from + replaced_size);
 
 	/* Even in case of data=writeback it is reasonable to pin
 	 * inode to transaction, to prevent unexpected data loss */
-- 
2.34.1


  parent reply	other threads:[~2023-06-19 21:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 21:18 [PATCH v2 0/5] clean up block_commit_write Bean Huo
2023-06-19 21:18 ` [PATCH v2 1/5] fs/buffer: " Bean Huo
2023-06-20  4:47   ` Christoph Hellwig
2023-06-20  5:33   ` Matthew Wilcox
2023-06-20 10:57     ` Bean Huo
2023-06-20 12:19       ` Matthew Wilcox
2023-06-19 21:18 ` Bean Huo [this message]
2023-06-20  3:00   ` [PATCH v2 2/5] ext4: No need to check return value of block_commit_write() Theodore Ts'o
2023-06-20  4:48   ` Christoph Hellwig
2023-06-20 10:59     ` Bean Huo
2023-06-19 21:18 ` [PATCH v2 3/5] fs/ocfs2: " Bean Huo
2023-06-19 21:18 ` [PATCH v2 4/5] udf: " Bean Huo
2023-06-19 21:18 ` [PATCH v2 5/5] fs/buffer.c: convert block_commit_write to return void Bean Huo

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=20230619211827.707054-3-beanhuo@iokpp.de \
    --to=beanhuo@iokpp.de \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=beanhuo@micron.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).