Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6137185rwd; Mon, 19 Jun 2023 02:58:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5I4hFUdQVjdUKeNufGUH342163BgqC/gOZfQhgXpmS1gfm6LkNZABginGI3kNzNW3jOOAc X-Received: by 2002:a05:6358:55:b0:12b:dc53:3f25 with SMTP id 21-20020a056358005500b0012bdc533f25mr1047412rwx.31.1687168689543; Mon, 19 Jun 2023 02:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687168689; cv=none; d=google.com; s=arc-20160816; b=tnnXQ5bFv9qLFhxMBLzE+kZfSIynktMH0bW3j1WcVlj+aodCfoWGDWG8400I3whGAD Z8Awwl5KDVBi9dPVw15wX/9becZgjWOGHGWwnJlWs2J+6CTptgUlU6Gg+QiHMB+Gv+Kl KgdOe1cURI8z//iBQRPCKeIttJefV5/2e5XJDm5ANc5N6a8UyPTveKCiuCIS0dIuiHyo pmAkWF1j6IRvvNguZV+BlwDICdeqPxHTo+Xm34cLPou3yVJJYBD8BDcFGvHVA9i0USb5 jaldMO3+nbHmXHOgf4h6LQHJ/JjohZJAls/T4uclpYL4wQ80hioHBRTYml9lQJ2WWaIm orkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=EHDB1goOIdClF7fSskWHB6HJ+dOH2Pf0/f+fBVNZKrI=; b=ToSFmfLs4cmBjO9ldMvbCnu2t1U0IrkvHwbudWmvbt0HuyJxBT+O9Q5dAu+EuzOizh uF2nP4sP+wAwNbutM1tgft5DxI8cQ0N83CVMCPOwfupEajxDjUP5cXpfBjeppBy8qbon A7XTvuat9vH4cKk3wvPf3VSCG0ClF6Fd3L9K8e3H+IN+47FU9MBJ9WoPnMNO7Ua5A67Z HbHdOXkswRlicpIBg+3NKk1yQ8dQkkS5S2ktKmbSnlisZOhJo3ZeohrAf71/ubLVVCb6 /tvVQFnzO5gsvGQCvTGodkGn1jzb7nuD270QQ7ICR4uESUEAx63iYf2mjQnDvzJtyT6X t+8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=DIpsb4Ei; dkim=neutral (no key) header.i=@suse.cz header.b=2cxWY7Vw; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m5-20020a638c05000000b0053ef815daebsi2160552pgd.253.2023.06.19.02.57.52; Mon, 19 Jun 2023 02:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=DIpsb4Ei; dkim=neutral (no key) header.i=@suse.cz header.b=2cxWY7Vw; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230413AbjFSJ4U (ORCPT + 99 others); Mon, 19 Jun 2023 05:56:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230469AbjFSJ4T (ORCPT ); Mon, 19 Jun 2023 05:56:19 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 361C9DE; Mon, 19 Jun 2023 02:56:18 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 732D121890; Mon, 19 Jun 2023 09:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1687168576; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EHDB1goOIdClF7fSskWHB6HJ+dOH2Pf0/f+fBVNZKrI=; b=DIpsb4EieamYZhyKaJCFxmJC6JO0cddEVy/1OyL8WDxOPeQGOtKMiVGqTxsIbrpLXpkxhN VXpLK+f++/JuAhTySMfcouo/j1p7MERtfqsoS0ULoRTD0YkD5mE84xRomR8ypCnrHqfM37 H8ssxvhCnHNv2dPJxVM4ndebL7WLdsY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1687168576; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EHDB1goOIdClF7fSskWHB6HJ+dOH2Pf0/f+fBVNZKrI=; b=2cxWY7Vw2OWzwjCUYjwhmawhiT+eBMOhUzAYEEySvXUmGZ1RMij4oQYT3UbwcV7Dqk24XK dqaTNsjGYQYbioDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6485A138E8; Mon, 19 Jun 2023 09:56:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id m1SIGEAmkGTiNgAAMHmgww (envelope-from ); Mon, 19 Jun 2023 09:56:16 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id F00FAA0755; Mon, 19 Jun 2023 11:56:15 +0200 (CEST) Date: Mon, 19 Jun 2023 11:56:15 +0200 From: Jan Kara To: Bean Huo Cc: 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, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com, beanhuo@micron.com Subject: Re: [PATCH v1 3/5] ext4: No need to check return value of block_commit_write() Message-ID: <20230619095615.pr6dw773bsruwqar@quack3> References: <20230618213250.694110-1-beanhuo@iokpp.de> <20230618213250.694110-4-beanhuo@iokpp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230618213250.694110-4-beanhuo@iokpp.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun 18-06-23 23:32:48, Bean Huo wrote: > From: Bean Huo > > Remove unnecessary check on the return value of block_commit_write(). > > Signed-off-by: Bean Huo Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > 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 > -- Jan Kara SUSE Labs, CR