From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37A28EEB585 for ; Thu, 12 Sep 2024 10:09:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABF406B0083; Thu, 12 Sep 2024 06:09:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A6EE96B0085; Thu, 12 Sep 2024 06:09:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95E1B6B0088; Thu, 12 Sep 2024 06:09:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 77A756B0083 for ; Thu, 12 Sep 2024 06:09:00 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 10A9F141EE6 for ; Thu, 12 Sep 2024 10:09:00 +0000 (UTC) X-FDA: 82555662840.11.7B3E1EB Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) by imf21.hostedemail.com (Postfix) with ESMTP id 249E41C0004 for ; Thu, 12 Sep 2024 10:08:57 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=UMwgcgBA; spf=pass (imf21.hostedemail.com: domain of luis.henriques@linux.dev designates 91.218.175.188 as permitted sender) smtp.mailfrom=luis.henriques@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726135710; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hVflXqkP81z7QLiKVN6pBzE3PtnoDKSX3xbNKszCIjo=; b=HQ12K3BiZqeSJWCE33iqeXj+jpogfs2ZReSjnVNNVWEo41ce/LGTitugFfcDFMDqIS3uaT Npu2EQULIwHu4L/A+xEapxiyJsv3qD5UFA9SCVFJ2pXL93/wJBLyI6+WE8Z9JrsjNKXwkc Wf+u9Qh0MxcJQPgn4FswiDwUSuqU/Ig= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=UMwgcgBA; spf=pass (imf21.hostedemail.com: domain of luis.henriques@linux.dev designates 91.218.175.188 as permitted sender) smtp.mailfrom=luis.henriques@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726135710; a=rsa-sha256; cv=none; b=Eqbnw6JuMmK2zwdOhsbwOeGwNDnreQxOyK3N+tWY/8bacztRFUrC/OOIT7ZwehWMTEurhy zAt/jJWN7jbzHDyW3LC0AwAmbMYhlKeqNeqnyu104EswyEDZJbXUfN4qUVmo+DREAFYgzY b6k1q102f0rM0W3CddFjSZ4qx68ZgXM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1726135735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hVflXqkP81z7QLiKVN6pBzE3PtnoDKSX3xbNKszCIjo=; b=UMwgcgBAreXJKIMzmfU6aRAuEampeFRPIO50gy+zvxZ8mhpTDN5Ayxaf+0QNeZkWFqy5qp 4jl4Hcn4dCVTno5wC8BMQ2t1V6Pbs4VdMu3+mc35mBacNXE4d5z4tJsmif+nHzPtPN9C3G JyPdThnIvmxuPFmBsGXkFAaQRXGoZvo= From: Luis Henriques To: Jan Kara Cc: kernel test robot , oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Theodore Ts'o Subject: Re: [linux-next:master 5690/11210] fs/ext4/fast_commit.c:362:21-23: WARNING !A || A && B is equivalent to !A || B In-Reply-To: <20240912094646.brhe2exsizgwzlai@quack3> (Jan Kara's message of "Thu, 12 Sep 2024 11:46:46 +0200") References: <202409120149.GdjqoVYQ-lkp@intel.com> <874j6lcmih.fsf@linux.dev> <20240912094646.brhe2exsizgwzlai@quack3> Date: Thu, 12 Sep 2024 11:08:41 +0100 Message-ID: <87y13xb2vq.fsf@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Stat-Signature: nw6q34dptgy4pwwxsk4u8wiaddt1ak6h X-Rspamd-Queue-Id: 249E41C0004 X-Rspamd-Server: rspam11 X-HE-Tag: 1726135737-668660 X-HE-Meta: U2FsdGVkX1+syqjsT9k2MpWgAkUWlrSAwlr9vpxMV8cUvFjuMMHE44KSBhmnSL71W+5qGzrMpOXBfliNqy7hZLeBrznD6AuIV15E5WnVVA5Ee7cB9TyNOiX8nUOk2qJnGxx+rI9Kv/kt/UN/x/nddTHtCfPEsclSvM+Khl8daGlhLxf5qQHLXKnX4AKyWX+qsqxuFzK+cmB1vWEs3si854Eo6zGv3pCiLukXyilXckf1qAnhFPKC4MrlB16BClqjrGPFIettz+k1++zUYOYr5sd2UWmx16bugjkxwdc/ceRrzLdqVIrqrDYuiR7RUJj5vj5E6wh6NjFsltaCWL14K0Q8hJCF0e9RH23ZA3ivACtM1U3SlKB/hUNJkn5uYNfbVHcBH3rhq66S1BMR90KWN3oIYRLEUgm/EA8W1nGg6InsmH8cdKNvU+ERHbqBDmAC2LP38vPeIKz+N4EiGvntExguVZMwXp3l2ZXPJ2tJL3GTJ7jj1jscq78t6u3CdqQb2v8rz3uGpJtABi7UMbS4nOxSibz4AObztLL3/uqW/sdJy4uQQxFgNIl/hpgFNFqsJHRTimGY2T0+Lf/o+Z29sxAgxnuzwNr6+fqgVOGERj2UhV5xVahUQoY8z7xFITzYssWyqLycfVXjmvqcmkV9XIOz3mcHNRsKkrUP2PfiXjDXYvtwg7/ZXHE8Ktt8z8nxEjQvC0yeUJkeazLofXdAw5RJWqHoH3TRE4B03WvjaKVH+B1WpJEqwwdjkZe5HjLagZthPz8/fz5MgQ3pteiRGceRd0ceukQnznhJLHhBkWHW3VLWOjI+jsOttP80czO12Zd9WnY/i5XvwXciV+vvfx6hR6vclT7IEXWUNpeTD8PSdOWhTNWT0fwae47GLR8OENFZ0alM4wKBBxNG3TRdWD8hOWfaIgrmlG/FALO9wNwp3qIoHpw66WsEwYFXwnIsXwlfsDnY7ZSLoBT8W7r 3fdUwCHG u5fXQB83/fBZ9Rj6RLkK8rfYdaLKx+/gGHWgXOhdUgxaBxB1TtYJvYJF8Uslm2KpLm4xqk6USdldtxRRb1800VpEbzHLzmkB+5EIv4Vzh4UZt8lNbh9nrMp4zqxec0xAM2Oi0C0VV1fPTYEAe2Qy3Y8jcV6jAHPpDLOAxbfG/EXE8iAQG8711zc9ZKbgdsFAmbsxh+hBpGi4w2h8e0ebpcexzpLCuwfwNqJx/TgtJdkZeOiDpb8qMQ6RXFBtpoLkRtCUUaddW9VZWtGlRuSchPJeIxJP8b80qNIQO1idSPVv0dyUlRmOTYwDUzqRF/zuP8zZ+VGVjTeT+Tz+OzBgC/5v9oIiRRTZpmo9womYaKx+oQc1j3X+NALpx4w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Sep 12 2024, Jan Kara wrote: > On Thu 12-09-24 09:19:18, Luis Henriques wrote: >> On Thu, Sep 12 2024, kernel test robot wrote: >>=20 >> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-nex= t.git master >> > head: 32ffa5373540a8d1c06619f52d019c6cdc948bb4 >> > commit: ebc4b2c1ac92fc0f8bf3f5a9c285a871d5084a6b [5690/11210] ext4: fi= x incorrect tid assumption in ext4_fc_mark_ineligible() >> > config: loongarch-randconfig-r063-20240911 (https://download.01.org/0d= ay-ci/archive/20240912/202409120149.GdjqoVYQ-lkp@intel.com/config) >> > compiler: loongarch64-linux-gcc (GCC) 14.1.0 >> > >> > If you fix the issue in a separate patch/commit (i.e. not just a new v= ersion of >> > the same patch/commit), kindly add following tags >> > | Reported-by: kernel test robot >> > | Closes: https://lore.kernel.org/oe-kbuild-all/202409120149.GdjqoVYQ-= lkp@intel.com/ >> > >> > cocci warnings: (new ones prefixed by >>) >> >>> fs/ext4/fast_commit.c:362:21-23: WARNING !A || A && B is equivalent = to !A || B >> > >> > vim +362 fs/ext4/fast_commit.c >> > >> > 332=09 >> > 333 /* >> > 334 * Mark file system as fast commit ineligible, and record latest >> > 335 * ineligible transaction tid. This means until the recorded >> > 336 * transaction, commit operation would result in a full jbd2 co= mmit. >> > 337 */ >> > 338 void ext4_fc_mark_ineligible(struct super_block *sb, int reason= , handle_t *handle) >> > 339 { >> > 340 struct ext4_sb_info *sbi =3D EXT4_SB(sb); >> > 341 tid_t tid; >> > 342 bool has_transaction =3D true; >> > 343 bool is_ineligible; >> > 344=09 >> > 345 if (ext4_fc_disabled(sb)) >> > 346 return; >> > 347=09 >> > 348 if (handle && !IS_ERR(handle)) >> > 349 tid =3D handle->h_transaction->t_tid; >> > 350 else { >> > 351 read_lock(&sbi->s_journal->j_state_lock); >> > 352 if (sbi->s_journal->j_running_transaction) >> > 353 tid =3D sbi->s_journal->j_running_transaction->t_tid; >> > 354 else >> > 355 has_transaction =3D false; >> > 356 read_unlock(&sbi->s_journal->j_state_lock); >> > 357 } >> > 358 spin_lock(&sbi->s_fc_lock); >> > 359 is_ineligible =3D ext4_test_mount_flag(sb, EXT4_MF_FC_INELIGIB= LE); >> > 360 if (has_transaction && >> > 361 (!is_ineligible || >> > > 362 (is_ineligible && tid_gt(tid, sbi->s_fc_ineligible_tid)))) >> > 363 sbi->s_fc_ineligible_tid =3D tid; >>=20 >> This suggestion is obviously correct. However, my brain found it much >> easier to write (and understand) this logic if written this way. >>=20 >> Ted, want me to re-send this patch (or a fix for it), or are you happy >> leaving it as is? > > I think I've already seen a patch for this. Yes [1]. Frankly I don't care > much but I slightly prefer the shorter variant. Oh! I totally missed that patch on the mailing-list. OK, so no action for me then. Thanks! > [1] https://lore.kernel.org/all/20240912090722.4e7o4l462y6hccau@quack3 (Minor nit: looks like this patch has a 'Closes:' tag pointing to a bugzilla link which isn't accessible at the moment. But maybe it's just a temporary '502'.) Cheers, --=20 Lu=C3=ADs