Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2054071lqo; Mon, 13 May 2024 06:45:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfWeDZCpoPwhXB48X+de0/f5V+v3th/fZG5Rr0ZLUFepY0xmvi9nsefvmmlSUdf8XtE9ojb1sc72yiOFzsW88/E6bocZXi7uuFadgKBQ== X-Google-Smtp-Source: AGHT+IHQ0jGOMePBijYjQCqYZGy0sooNHwIRnR0DdqvPssz1fdFhW3RwJpvB09iyIkFEnfZAtVVA X-Received: by 2002:a05:6214:451c:b0:6a0:ce12:b8a4 with SMTP id 6a1803df08f44-6a1681bc3fcmr126831836d6.21.1715607934396; Mon, 13 May 2024 06:45:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715607934; cv=pass; d=google.com; s=arc-20160816; b=iv8kjK5zmjQUp74QMDH9SFKLHrntODwPLQavnW3sfiAeuVaakMPApBh1qRD1mAQcj7 X+SVyHTaDykZMU2PTcde1W7WsIA7B20j49QccUoeAFFSeexxve4NhInhpb7u+e+w3uTd UhXYPaFYdEV4xQKwVWlzbQsh8zg6b1sY8NnlOPsXHgdT0IHtzA7cFwpHhTbocITOAs72 BLUjQDYSJhhcX6j9bk9E46ttP+n+D7hSP4YBJK1YAh854HvQzi7+sTVak3WkWtKn8NW7 Hy71dVQDpURuUYaUD7TbsNWIDSfnMJp+dv6/RRH9z2FrmF5Tu8NLGX69rEmbhAyt/WRA nOVw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=jv6058otnH+uK/D6TMYgyXy8L3PlzLOlJi3KPN9MW6o=; fh=Yf8KxdvJj8sY/Bpxw4ThLi2J4FGkot3tSZ5JKsahmyk=; b=i+c0YFHDsWaLxLTf/bSr+3+SO4Q9STosEAwVS/rEDO/DLSp2Kyw3Ei+o3jATdBylWE WsJPewmOtUapcGu5ErA5KP10nn/qEZt37/pE6TLn3IwfIeTLL0SZ4ZK/7gNLTbYQzcFF AXenrXrfNwOc/95SnEmGNOLipWLu8edlHM0dKan2YiQ/O+8b0DfV3c/dDkg4dKRofXir N7Ae0BQmfM3ZesIT6/xmuAzrCCyk74kb6Qku6ePQs3oeWTUbQr5NlllzW7WYVEDLNmn+ gj97vK5iLFp4fttIRtjvNU1e0fl0Cukh6o+38TnBTgT4Ttdt7Wk6UtfW9/O6C/WtHmRE QTBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=U0SzHXu5; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=U0SzHXu5; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-177648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177648-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1d6926si96457136d6.94.2024.05.13.06.45.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 06:45:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=U0SzHXu5; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=U0SzHXu5; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-177648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177648-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 16C061C21447 for ; Mon, 13 May 2024 13:45:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58D48157E98; Mon, 13 May 2024 13:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="U0SzHXu5"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="7HE3OQMp"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="U0SzHXu5"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="7HE3OQMp" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28BE4153BE7; Mon, 13 May 2024 13:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715607702; cv=none; b=esfM9nBZ+wa+sC9hwaSykhE2PrisFCUkvBaSsvId+WmZc4g84HnwL/K1fQXefDlwtZx+0NmZOP2QJmKdyq573Bgk5g9fZb9AgpHjASsz5u6eaMRNolOfinDztbsoww8J6mRAXBEcrRhS87lfEKP9X6gmsf4Icay3JPxIcPpu2yI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715607702; c=relaxed/simple; bh=bnKv9hUuEE6isl5vUdapDAM5AvVUq4o+jPsROipumjY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JXeD5mTfizhX015lwB/VaQAQJI1+UzL1JLed9K4n1RJrcxJSVUj9soXXIPpp1gZNhKjBmCxp1AP3JWd09BHyGctdYQ7i5KOpMgdQUcBv+r4HWCZxnoDyA+C8OrfZVeyfOtlAzUyeTyYrZs3fWc5At54g2BVuuAjIZMDeNhpOtIc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=U0SzHXu5; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=7HE3OQMp; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=U0SzHXu5; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=7HE3OQMp; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 32E1434A54; Mon, 13 May 2024 13:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1715607696; 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=jv6058otnH+uK/D6TMYgyXy8L3PlzLOlJi3KPN9MW6o=; b=U0SzHXu5ved92dklWliu0gYyGvo2cTWCquM9Y5M3it/6DiwO0i553RnYUqNGTL0YUas9Sp sDnIemX53089ua98IqFMLRCcdp2W9SAUoP8od1L03jaJq2Gtc9S55o7uUaMR0iYmIielbg exL6dH2IU1X8A3OyfshVIAd/9cjnkAs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1715607696; 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=jv6058otnH+uK/D6TMYgyXy8L3PlzLOlJi3KPN9MW6o=; b=7HE3OQMpygvUyUhHq2kzt5qk9OJipVG1QL5pcyuj0by8rzEUcNv4KQLuijCvaIGnki+lvf DPblRSs22o6rkNAA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1715607696; 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=jv6058otnH+uK/D6TMYgyXy8L3PlzLOlJi3KPN9MW6o=; b=U0SzHXu5ved92dklWliu0gYyGvo2cTWCquM9Y5M3it/6DiwO0i553RnYUqNGTL0YUas9Sp sDnIemX53089ua98IqFMLRCcdp2W9SAUoP8od1L03jaJq2Gtc9S55o7uUaMR0iYmIielbg exL6dH2IU1X8A3OyfshVIAd/9cjnkAs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1715607696; 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=jv6058otnH+uK/D6TMYgyXy8L3PlzLOlJi3KPN9MW6o=; b=7HE3OQMpygvUyUhHq2kzt5qk9OJipVG1QL5pcyuj0by8rzEUcNv4KQLuijCvaIGnki+lvf DPblRSs22o6rkNAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E7E0513A6F; Mon, 13 May 2024 13:41:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id unAoOI8YQmZaDwAAD6G6ig (envelope-from ); Mon, 13 May 2024 13:41:35 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 31CBAA08DA; Sun, 12 May 2024 13:06:35 +0200 (CEST) Date: Sun, 12 May 2024 13:06:35 +0200 From: Jan Kara To: Kemeng Shi Cc: tytso@mit.edu, jack@suse.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/9] jbd2: remove unnedded "need_copy_out" in jbd2_journal_write_metadata_buffer Message-ID: <20240512110635.qqllcn2q4dfyvmzr@quack3> References: <20240506141801.1165315-1-shikemeng@huaweicloud.com> <20240506141801.1165315-4-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240506141801.1165315-4-shikemeng@huaweicloud.com> X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; DATE_IN_PAST(1.00)[26]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email,suse.cz:email] X-Spam-Score: -2.80 X-Spam-Flag: NO On Mon 06-05-24 22:17:55, Kemeng Shi wrote: > As we only need to copy out when we should do escape, need_copy_out > could be simply replaced by "do_escape". > > Signed-off-by: Kemeng Shi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/jbd2/journal.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c > index 068031f35aea..9a35d0c5b38c 100644 > --- a/fs/jbd2/journal.c > +++ b/fs/jbd2/journal.c > @@ -327,7 +327,6 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, > struct buffer_head **bh_out, > sector_t blocknr) > { > - int need_copy_out = 0; > int done_copy_out = 0; > int do_escape = 0; > char *mapped_data; > @@ -382,16 +381,14 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, > /* > * Check for escaping > */ > - if (*((__be32 *)mapped_data) == cpu_to_be32(JBD2_MAGIC_NUMBER)) { > - need_copy_out = 1; > + if (*((__be32 *)mapped_data) == cpu_to_be32(JBD2_MAGIC_NUMBER)) > do_escape = 1; > - } > kunmap_local(mapped_data); > > /* > * Do we need to do a data copy? > */ > - if (need_copy_out && !done_copy_out) { > + if (do_escape && !done_copy_out) { > char *tmp; > > spin_unlock(&jh_in->b_state_lock); > -- > 2.30.0 > -- Jan Kara SUSE Labs, CR