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 CEF09EEB57D for ; Thu, 12 Sep 2024 09:46:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F1C66B0083; Thu, 12 Sep 2024 05:46:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A19A6B0085; Thu, 12 Sep 2024 05:46:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46A436B0088; Thu, 12 Sep 2024 05:46:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 24A3B6B0083 for ; Thu, 12 Sep 2024 05:46:55 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9D5DCA9F19 for ; Thu, 12 Sep 2024 09:46:54 +0000 (UTC) X-FDA: 82555607148.30.DEE0633 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf25.hostedemail.com (Postfix) with ESMTP id 1F832A0011 for ; Thu, 12 Sep 2024 09:46:51 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=rxHSvDCN; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="5RThT/bT"; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=rxHSvDCN; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="5RThT/bT"; spf=pass (imf25.hostedemail.com: domain of jack@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726134384; 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=jjqYXLeX6jDX6MeFgNLd5a3RJUBnqDbux8HPOmf+iE8=; b=Fq56FvrW2CoozThMWp/N6iH5rGu68Epjkv2ueLhqhv8dDtKruqTpXDwPablKj8kk0BfUP0 RnYj5Bojlgab8qCU/Ccg+Qdkb5DjFRDw6NZO5ECUv1IouvaWdWrJc2osPe9LxUx1VW4fTl c+hKnA1EAvz8Pme0qnn1To2jQhQylnU= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=rxHSvDCN; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="5RThT/bT"; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=rxHSvDCN; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="5RThT/bT"; spf=pass (imf25.hostedemail.com: domain of jack@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726134384; a=rsa-sha256; cv=none; b=Ifr3/v62j+jb/q1FewLyBCuf8n7PbZZljbJk061vpqeCvKe8aO4vnUFlr8WYL2ZvTBoiB5 wDsNQorMH9jMiR8KVvBAlyjvJG3SrQRCwZYuuXWUyVQG/Jjg0q+hHZngAUR5oam5Y3+gKg uSmauiKB7eb40oAziaZTxVYTh1HaPR0= Received: from imap1.dmz-prg2.suse.org (unknown [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-out2.suse.de (Postfix) with ESMTPS id 6923A1F76E; Thu, 12 Sep 2024 09:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1726134410; h=from:from:reply-to: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=jjqYXLeX6jDX6MeFgNLd5a3RJUBnqDbux8HPOmf+iE8=; b=rxHSvDCNyw+LUeBEdU2jmQ+ykrDiDMjKdzirUpzZIFJSWOcVlbTZ2Cfp9DNWO595TjiVMR PJHV2cxTs7FJIXBpbmsbTDuNy1aVE2PW2wab0ST5Kg6zZo55Tu1wZSK39tRUALMFYYBHD2 lYPmHidmHEZQUlaeKmtI+LKAd2QWGyw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1726134410; h=from:from:reply-to: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=jjqYXLeX6jDX6MeFgNLd5a3RJUBnqDbux8HPOmf+iE8=; b=5RThT/bTyGIvxGSduTQNkv7xIJFzhDXie2f0qESKwCluEaSi5RL4d00fm3SGo5pTUsRxCI 5x4/+ybXtQXbS5Cw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1726134410; h=from:from:reply-to: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=jjqYXLeX6jDX6MeFgNLd5a3RJUBnqDbux8HPOmf+iE8=; b=rxHSvDCNyw+LUeBEdU2jmQ+ykrDiDMjKdzirUpzZIFJSWOcVlbTZ2Cfp9DNWO595TjiVMR PJHV2cxTs7FJIXBpbmsbTDuNy1aVE2PW2wab0ST5Kg6zZo55Tu1wZSK39tRUALMFYYBHD2 lYPmHidmHEZQUlaeKmtI+LKAd2QWGyw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1726134410; h=from:from:reply-to: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=jjqYXLeX6jDX6MeFgNLd5a3RJUBnqDbux8HPOmf+iE8=; b=5RThT/bTyGIvxGSduTQNkv7xIJFzhDXie2f0qESKwCluEaSi5RL4d00fm3SGo5pTUsRxCI 5x4/+ybXtQXbS5Cw== 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 5E09A13A73; Thu, 12 Sep 2024 09:46:50 +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 zaPuFoq44mZ5KAAAD6G6ig (envelope-from ); Thu, 12 Sep 2024 09:46:50 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 0FF57A08B3; Thu, 12 Sep 2024 11:46:46 +0200 (CEST) Date: Thu, 12 Sep 2024 11:46:46 +0200 From: Jan Kara To: Luis Henriques Cc: kernel test robot , 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 Message-ID: <20240912094646.brhe2exsizgwzlai@quack3> References: <202409120149.GdjqoVYQ-lkp@intel.com> <874j6lcmih.fsf@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <874j6lcmih.fsf@linux.dev> X-Rspam-User: X-Stat-Signature: 869gbqhawoh4bne5dtqbn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g33 psOb84UHomfp8DC7wSo3NYIRC7skmyfIA3QoOQNMSbrLd9F9wls2k04D4f03mVAi5ImJsmZix69PBjEX858DaP4bUnWMN3Lvme4tKA9xA46zpaQt3rbN10arCieHM1mF8rSBcxjiPQQH0KfNizeVmxlCWewPbterqUlaC76C59isrBR237xctrj7nPOdqrQCN/EnNkGpCsacppvxyj7xGL3oRrKoCxJioEQH2Oqtene0xknrXhahp/HDvkiatpTEYK7CPyGy53REnF1/H/wDqdJhEHVBLkVsr69IWI5WB1wnG5FNiiZAU/ikgqFoJwgsWoBTJlXwiL9PwzhhMCxgCP2cHSW2PC5dRrQwM3xhRl3RLk1p5uRb1nACaPxywsGjzQAuigYfMBlvlQjhbH2nu9OW8Pv582kCACrQwp00e14W1NrNbiVtr03lLDmtAV47Gvtbk6ZnXHmFN3w8hVlUsErK4VivP8oa8aQhqT+RsUvM+yaHJW3ldvblXH82i56vzIqrlln1u0AD8B7AesjmUa1hMEyY2VN8ArjEWh6Pf3VeqCW+2hczY3cvbkbgNvg9lrz8uqgGG/nLVwjEl/xovqr/cdYrh1VhjAbtoBZ6GK6Hfz9U= 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 12-09-24 09:19:18, Luis Henriques wrote: > On Thu, Sep 12 2024, kernel test robot wrote: > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > > head: 32ffa5373540a8d1c06619f52d019c6cdc948bb4 > > commit: ebc4b2c1ac92fc0f8bf3f5a9c285a871d5084a6b [5690/11210] ext4: fix incorrect 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 version 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 > > 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 commit. > > 337 */ > > 338 void ext4_fc_mark_ineligible(struct super_block *sb, int reason, handle_t *handle) > > 339 { > > 340 struct ext4_sb_info *sbi = EXT4_SB(sb); > > 341 tid_t tid; > > 342 bool has_transaction = true; > > 343 bool is_ineligible; > > 344 > > 345 if (ext4_fc_disabled(sb)) > > 346 return; > > 347 > > 348 if (handle && !IS_ERR(handle)) > > 349 tid = 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 = sbi->s_journal->j_running_transaction->t_tid; > > 354 else > > 355 has_transaction = false; > > 356 read_unlock(&sbi->s_journal->j_state_lock); > > 357 } > > 358 spin_lock(&sbi->s_fc_lock); > > 359 is_ineligible = 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 = 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? 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. [1] https://lore.kernel.org/all/20240912090722.4e7o4l462y6hccau@quack3 Honza > > Cheers, > -- > Luís > > > 364 ext4_set_mount_flag(sb, EXT4_MF_FC_INELIGIBLE); 365 > > spin_unlock(&sbi->s_fc_lock); 366 WARN_ON(reason >= > > EXT4_FC_REASON_MAX); 367 > > sbi->s_fc_stats.fc_ineligible_reason_count[reason]++; 368 } 369 > > > > -- > > 0-DAY CI Kernel Test Service > > https://github.com/intel/lkp-tests/wiki > -- Jan Kara SUSE Labs, CR