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 6C637EE645F for ; Thu, 12 Sep 2024 08:19:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C6F196B0083; Thu, 12 Sep 2024 04:19:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C1F896B0085; Thu, 12 Sep 2024 04:19:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE7F06B0088; Thu, 12 Sep 2024 04:19:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 92B726B0083 for ; Thu, 12 Sep 2024 04:19:33 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 21B0B121478 for ; Thu, 12 Sep 2024 08:19:33 +0000 (UTC) X-FDA: 82555387026.13.08B0266 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) by imf07.hostedemail.com (Postfix) with ESMTP id 47A1F40006 for ; Thu, 12 Sep 2024 08:19:30 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=So9TtO9t; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf07.hostedemail.com: domain of luis.henriques@linux.dev designates 91.218.175.184 as permitted sender) smtp.mailfrom=luis.henriques@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726129142; a=rsa-sha256; cv=none; b=b9+fgzxcZRSkAyQtQpvkNsHqEl5EzQu9R0ZJ9R7TeY54MOZBbzQmW5XK7YtyC+Vbolu9vG J+rIIMRVZ/rfs8XZfdRIDIYgMxLpAs2IYjHri2c8/XJCgXNQwKKYTfCihcqa2UyZvcMfbL p1EXWZcgsKMNb56ZqXif5pYUnasUwkk= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=So9TtO9t; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf07.hostedemail.com: domain of luis.henriques@linux.dev designates 91.218.175.184 as permitted sender) smtp.mailfrom=luis.henriques@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726129142; 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=9CQifcZ2WrGX2rzMNEg+NhE8zUJOuIH6qsj52bCYDnM=; b=kbkDIfcKIuXcptuCJBXTHiExovHdy3No11Jgjbzx3kAh9NjmxLEmkIPt/CbPARQ7AqOkX8 z4kpVH0U8rzyHDA4/X2UY5MzN2wV4avqelIvdrN+txVOZ4kpN/7m64HmvaHLusCwTejeRM liElqiypx1qmYt7U0bMxw91HnWQpXkA= 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=1726129168; 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=9CQifcZ2WrGX2rzMNEg+NhE8zUJOuIH6qsj52bCYDnM=; b=So9TtO9t2ll30oflYbv4fR3/MbMvIovLx83aXoV8yhI1sJ9SJeu5pUwEN9U2fKWqVny289 0vsgkk76Xkg+qJoPBdtJUNcQOxs+veA5WCoiIX47sb/ePZgb/6xsnfyC6YogHhj+U3li1z UEgq2xTPIdWzsYI7njMpadzJhKl1kuE= From: Luis Henriques To: kernel test robot Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Theodore Ts'o , Jan Kara 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: <202409120149.GdjqoVYQ-lkp@intel.com> (kernel test robot's message of "Thu, 12 Sep 2024 01:14:59 +0800") References: <202409120149.GdjqoVYQ-lkp@intel.com> Date: Thu, 12 Sep 2024 09:19:18 +0100 Message-ID: <874j6lcmih.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-Rspamd-Queue-Id: 47A1F40006 X-Rspamd-Server: rspam01 X-Stat-Signature: ck3kbmxbsw7ij7mnyzg1rx53883kihw3 X-HE-Tag: 1726129170-263406 X-HE-Meta: U2FsdGVkX19GlcKB7k3niNk/ShqZVLE9c5p+ZF+yIg4ikWG9LDhTAuWOGCRD4GgKXNOuhmlpFEx12Pzh27bJTkwGX/d6bRzyrEK9M7vcmScQlEjAiNa+n4V9uUpORkcMJwuXpG9B3w+uK+5gJ1jCBV8y7ZBC9LpnseqhzcYsX6Eghj9v+ZEMOJN2swh1l4Yuc6IDL4P83PGz+G0I0cRERJKdB7dtW4FwAGu1XXp4FLq8mISkHwu9KjVKHG/SskVQzwKyP74JIHrKGi0FXVqM+NRrPatFinXe5u8tSxErBW0OK+ro2lwcyQAeKuRQflGGGT3vsYKIHmfpppRIBBpitBpenDbE2ntl7cJXvxChuUHa2m+yVfcZFUvRK75fQPPv5P+1fm5A/E62Z1GjP9NO7eN5gg+R6V8vjuzM+AcdEICuuhRz13A+HubPzsGFc748jWt13Q/9hLPqdV8nGmXZydUai8gHALxeUFPCds/3qeCX4DEIa9q/8Px+/qd6EFIYUg7xk8VzyALCTUMJQUZCjELakmfvt3b0hxnUsF/QQjtArYo7BlsSyzGGSOefrNG3sujGnDt8oBgoDfqtwPolORKX/vKlumtLvZxjCoMnrpvR2m1E/tIrAl7P04EnaBBxMaXW3nvKeN9safheDP85mgW5ngmbvOBiBrogXlcdwDLLmpJQa8QhtJupHYBcEz2CJeXIirJp8NuCRrVzolFywC6UOwhQkboUMOkFGf0zdZN49ZLgxrx6UrTOPFJzEmkDG4xUsEZMY34BjFIOg17UiJ9x5WGUstD/xhBzN0a08zLQwJ7Yloxgvs3cPgwiz6XS+oXE4Wrix4WdH3PkS/Sdtpl4nOhb0MZ2RlTPyQOWCo0w6+D3Q5I8iMAEQ3pHwGMxRHv0KY23ooRGQkQHKUwP7/+xHCpnfsTErn3xyHpq1aWe4gubhYZgeGN36ORpJqVK0mgEOaNAMCyqhE+3PlY wKyUaRGP Biq3V1Foa9G2MwvjZTwUgWh7os8WkiicbG90ARj+FY43pl6fvnXpUS8sGWkKyqkAec7HpVoVvef8hOsWQhZFrs/UnVwXftaM6rtGSl580LGAy2JeGINQYeNdIaUjnXj1qYDipdla6QimkKeRqmiAJl5xW/G2r7nprpcNlodpl6EOKjRhHBYTA9N8Du4Qm0EPXV2OqW4A5QAhQCzLnFi8pF3Z64K0BQXhp0RlXJocJhg+rbQNf/INsoK7QZvHGZCVu0A9BA1lmrhVWAfsP2BVeCMUG6ncYZQIOuScGEzo0XooLBKATHluhBwrqeCDT7ZLmtGGIMEfWBpbRUYwK4Jc4CDTD4YTQTgV4x5mfRHW4+DNFh1x+uMldx7TtQ4BUPTwfFZAbVaAbAHvqykk= 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, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.g= it master > head: 32ffa5373540a8d1c06619f52d019c6cdc948bb4 > commit: ebc4b2c1ac92fc0f8bf3f5a9c285a871d5084a6b [5690/11210] ext4: fix i= ncorrect tid assumption in ext4_fc_mark_ineligible() > config: loongarch-randconfig-r063-20240911 (https://download.01.org/0day-= 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 vers= ion 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 commi= t. > 337 */ > 338 void ext4_fc_mark_ineligible(struct super_block *sb, int reason, h= andle_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_INELIGIBLE); > 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; This suggestion is obviously correct. However, my brain found it much easier to write (and understand) this logic if written this way. Ted, want me to re-send this patch (or a fix for it), or are you happy leaving it as is? Cheers, --=20 Lu=C3=ADs > 364 ext4_set_mount_flag(sb, EXT4_MF_FC_INELIGIBLE); 365 > spin_unlock(&sbi->s_fc_lock); 366 WARN_ON(reason >=3D > EXT4_FC_REASON_MAX); 367 > sbi->s_fc_stats.fc_ineligible_reason_count[reason]++; 368 } 369 > > --=20 > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki