fs/ext4/mballoc.c:4597:47-50: opportunity for str_yes_no(ret) (fwd)
From: Julia Lawall
Date: Sun Oct 06 2024 - 11:11:08 EST
---------- Forwarded message ----------
Date: Sun, 6 Oct 2024 22:59:43 +0800
From: kernel test robot <lkp@xxxxxxxxx>
To: oe-kbuild@xxxxxxxxxxxxxxx
Cc: lkp@xxxxxxxxx, Julia Lawall <julia.lawall@xxxxxxxx>
Subject: fs/ext4/mballoc.c:4597:47-50: opportunity for str_yes_no(ret)
BCC: lkp@xxxxxxxxx
CC: oe-kbuild-all@xxxxxxxxxxxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
TO: Ritesh Harjani <riteshh@xxxxxxxxxxxxx>
CC: "Theodore Ts'o" <tytso@xxxxxxx>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8f602276d3902642fdc3429b548d73c745446601
commit: 07b5b8e1ac4004b7db1065a301df65cd434c31c9 ext4: mballoc: introduce pcpu seqcnt for freeing PA to improve ENOSPC handling
date: 4 years, 4 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 4 years, 4 months ago
config: x86_64-randconfig-102-20241006 (https://download.01.org/0day-ci/archive/20241006/202410062256.BoynX3c2-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.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 <lkp@xxxxxxxxx>
| Reported-by: Julia Lawall <julia.lawall@xxxxxxxx>
| Closes: https://lore.kernel.org/r/202410062256.BoynX3c2-lkp@xxxxxxxxx/
cocci warnings: (new ones prefixed by >>)
>> fs/ext4/mballoc.c:4597:47-50: opportunity for str_yes_no(ret)
vim +4597 fs/ext4/mballoc.c
c9de560ded61fa Alex Tomas 2008-01-29 4577
cf5e2ca6c99077 Ritesh Harjani 2020-05-20 4578 static bool ext4_mb_discard_preallocations_should_retry(struct super_block *sb,
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4579 struct ext4_allocation_context *ac, u64 *seq)
cf5e2ca6c99077 Ritesh Harjani 2020-05-20 4580 {
cf5e2ca6c99077 Ritesh Harjani 2020-05-20 4581 int freed;
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4582 u64 seq_retry = 0;
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4583 bool ret = false;
cf5e2ca6c99077 Ritesh Harjani 2020-05-20 4584
cf5e2ca6c99077 Ritesh Harjani 2020-05-20 4585 freed = ext4_mb_discard_preallocations(sb, ac->ac_o_ex.fe_len);
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4586 if (freed) {
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4587 ret = true;
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4588 goto out_dbg;
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4589 }
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4590 seq_retry = ext4_get_discard_pa_seq_sum();
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4591 if (seq_retry != *seq) {
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4592 *seq = seq_retry;
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4593 ret = true;
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4594 }
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4595
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4596 out_dbg:
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 @4597 mb_debug(sb, "freed %d, retry ? %s\n", freed, ret ? "yes" : "no");
07b5b8e1ac4004 Ritesh Harjani 2020-05-20 4598 return ret;
cf5e2ca6c99077 Ritesh Harjani 2020-05-20 4599 }
cf5e2ca6c99077 Ritesh Harjani 2020-05-20 4600
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki