From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: include/trace/events/ext4.h:1820:1: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
Date: Tue, 05 Jul 2022 12:09:09 +0800 [thread overview]
Message-ID: <202207051222.G2bplCnH-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 13500 bytes --]
::::::
:::::: Manual check reason: "commit no functional change"
:::::: Manual check reason: "low confidence static check first_new_problem: include/trace/events/ext4.h:1820:1: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]"
::::::
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Wang Jianchao <wangjianchao@kuaishou.com>
CC: "Theodore Ts'o" <tytso@mit.edu>
CC: Andreas Dilger <adilger@dilger.ca>
CC: Jan Kara <jack@suse.cz>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c1084b6c5620a743f86947caca66d90f24060f56
commit: 6920b3913235f517728bb69abe9b39047a987113 ext4: add new helper interface ext4_try_to_trim_range()
date: 11 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 11 months ago
config: s390-randconfig-c005-20220702 (https://download.01.org/0day-ci/archive/20220705/202207051222.G2bplCnH-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5d787689b14574fe58ba9798563f4a6df6059fbf)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6920b3913235f517728bb69abe9b39047a987113
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6920b3913235f517728bb69abe9b39047a987113
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
fs/ext4/mballoc.c:6375:7: note: Assuming the condition is true
if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
^
include/linux/compiler.h:78:40: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~
fs/ext4/mballoc.c:6375:3: note: Taking false branch
if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
^
fs/ext4/mballoc.c:6387:7: note: Assuming 'group' is not equal to 'last_group'
if (group == last_group)
^~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6387:3: note: Taking false branch
if (group == last_group)
^
fs/ext4/mballoc.c:6390:7: note: Assuming 'minlen' is > field 'bb_free'
if (grp->bb_free >= minlen) {
^~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6390:3: note: Taking false branch
if (grp->bb_free >= minlen) {
^
fs/ext4/mballoc.c:6372:28: note: Assuming 'group' is <= 'last_group'
for (group = first_group; group <= last_group; group++) {
^~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6372:2: note: Loop condition is true. Entering loop body
for (group = first_group; group <= last_group; group++) {
^
fs/ext4/mballoc.c:6375:7: note: Assuming the condition is true
if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
^
include/linux/compiler.h:78:40: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~
fs/ext4/mballoc.c:6375:3: note: Taking false branch
if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
^
fs/ext4/mballoc.c:6387:7: note: Assuming 'group' is not equal to 'last_group'
if (group == last_group)
^~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6387:3: note: Taking false branch
if (group == last_group)
^
fs/ext4/mballoc.c:6390:7: note: Assuming 'minlen' is <= field 'bb_free'
if (grp->bb_free >= minlen) {
^~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6390:3: note: Taking true branch
if (grp->bb_free >= minlen) {
^
fs/ext4/mballoc.c:6391:10: note: Calling 'ext4_trim_all_free'
cnt = ext4_trim_all_free(sb, group, first_cluster,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6298:6: note: Assuming 'ret' is 0
if (ret) {
^~~
fs/ext4/mballoc.c:6298:2: note: Taking false branch
if (ret) {
^
fs/ext4/mballoc.c:6306:6: note: Assuming the condition is true
if (!EXT4_MB_GRP_WAS_TRIMMED(e4b.bd_info) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6306:44: note: Left side of '||' is true
if (!EXT4_MB_GRP_WAS_TRIMMED(e4b.bd_info) ||
^
fs/ext4/mballoc.c:6308:9: note: Calling 'ext4_try_to_trim_range'
ret = ext4_try_to_trim_range(sb, &e4b, start, max, minblocks);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6230:11: note: Assuming 'start' is >= field 'bb_first_free'
start = (e4b->bd_info->bb_first_free > start) ?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6230:10: note: '?' condition is false
start = (e4b->bd_info->bb_first_free > start) ?
^
fs/ext4/mballoc.c:6235:9: note: Assuming 'start' is <= 'max'
while (start <= max) {
^~~~~~~~~~~~
fs/ext4/mballoc.c:6235:2: note: Loop condition is true. Entering loop body
while (start <= max) {
^
fs/ext4/mballoc.c:6237:7: note: Assuming 'start' is <= 'max'
if (start > max)
^~~~~~~~~~~
fs/ext4/mballoc.c:6237:3: note: Taking false branch
if (start > max)
^
fs/ext4/mballoc.c:6241:7: note: Assuming the condition is false
if ((next - start) >= minblocks) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6241:3: note: Taking false branch
if ((next - start) >= minblocks) {
^
fs/ext4/mballoc.c:6251:28: note: Dereference of null pointer
if (fatal_signal_pending(current)) {
^
arch/s390/include/asm/current.h:17:45: note: expanded from macro 'current'
#define current ((struct task_struct *const)S390_lowcore.current_task)
^~~~~~~~~~~~~~~~~~~~~~~~~
arch/s390/include/asm/lowcore.h:200:22: note: expanded from macro 'S390_lowcore'
#define S390_lowcore (*((struct lowcore *) 0))
^
>> include/trace/events/ext4.h:1820:1: warning: Dereference of null pointer [clang-analyzer-core.NullDereference]
DEFINE_EVENT(ext4__trim, ext4_trim_extent,
^
include/linux/tracepoint.h:542:2: note: expanded from macro 'DEFINE_EVENT'
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
^
include/linux/tracepoint.h:420:15: note: expanded from macro 'DECLARE_TRACE'
cpu_online(raw_smp_processor_id()), \
^
arch/s390/include/asm/smp.h:15:32: note: expanded from macro 'raw_smp_processor_id'
#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
^
fs/ext4/mballoc.c:6352:6: note: Assuming 'minlen' is <= field 's_clusters_per_group'
if (minlen > EXT4_CLUSTERS_PER_GROUP(sb) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6352:6: note: Left side of '||' is false
fs/ext4/mballoc.c:6353:6: note: Assuming 'start' is < 'max_blks'
start >= max_blks ||
^~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6352:6: note: Left side of '||' is false
if (minlen > EXT4_CLUSTERS_PER_GROUP(sb) ||
^
fs/ext4/mballoc.c:6354:6: note: Assuming field 'len' is >= field 's_blocksize'
range->len < sb->s_blocksize)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6352:2: note: Taking false branch
if (minlen > EXT4_CLUSTERS_PER_GROUP(sb) ||
^
fs/ext4/mballoc.c:6356:6: note: Assuming 'end' is < 'max_blks'
if (end >= max_blks)
^~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6356:2: note: Taking false branch
if (end >= max_blks)
^
fs/ext4/mballoc.c:6358:6: note: Assuming 'end' is > 'first_data_blk'
if (end <= first_data_blk)
^~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6358:2: note: Taking false branch
if (end <= first_data_blk)
^
fs/ext4/mballoc.c:6360:6: note: Assuming 'start' is >= 'first_data_blk'
if (start < first_data_blk)
^~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6360:2: note: Taking false branch
if (start < first_data_blk)
^
fs/ext4/mballoc.c:6372:28: note: Assuming 'group' is <= 'last_group'
for (group = first_group; group <= last_group; group++) {
^~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6372:2: note: Loop condition is true. Entering loop body
for (group = first_group; group <= last_group; group++) {
^
fs/ext4/mballoc.c:6375:7: note: Assuming the condition is true
if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
^
include/linux/compiler.h:78:40: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~
fs/ext4/mballoc.c:6375:3: note: Taking false branch
if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
^
fs/ext4/mballoc.c:6387:7: note: Assuming 'group' is not equal to 'last_group'
if (group == last_group)
^~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6387:3: note: Taking false branch
if (group == last_group)
^
fs/ext4/mballoc.c:6390:7: note: Assuming 'minlen' is > field 'bb_free'
if (grp->bb_free >= minlen) {
^~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6390:3: note: Taking false branch
if (grp->bb_free >= minlen) {
^
fs/ext4/mballoc.c:6372:28: note: Assuming 'group' is <= 'last_group'
for (group = first_group; group <= last_group; group++) {
^~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6372:2: note: Loop condition is true. Entering loop body
for (group = first_group; group <= last_group; group++) {
^
fs/ext4/mballoc.c:6375:7: note: Assuming the condition is true
if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
^
include/linux/compiler.h:78:40: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~
fs/ext4/mballoc.c:6375:3: note: Taking false branch
if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
^
fs/ext4/mballoc.c:6387:7: note: Assuming 'group' is not equal to 'last_group'
if (group == last_group)
^~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6387:3: note: Taking false branch
if (group == last_group)
^
fs/ext4/mballoc.c:6390:7: note: Assuming 'minlen' is > field 'bb_free'
if (grp->bb_free >= minlen) {
^~~~~~~~~~~~~~~~~~~~~~
fs/ext4/mballoc.c:6390:3: note: Taking false branch
if (grp->bb_free >= minlen) {
^
fs/ext4/mballoc.c:6372:28: note: Assuming 'group' is <= 'last_group'
vim +1820 include/trace/events/ext4.h
b3d4c2b10b68d2 Tao Ma 2011-07-11 1819
b3d4c2b10b68d2 Tao Ma 2011-07-11 @1820 DEFINE_EVENT(ext4__trim, ext4_trim_extent,
b3d4c2b10b68d2 Tao Ma 2011-07-11 1821
b3d4c2b10b68d2 Tao Ma 2011-07-11 1822 TP_PROTO(struct super_block *sb,
b3d4c2b10b68d2 Tao Ma 2011-07-11 1823 ext4_group_t group,
b3d4c2b10b68d2 Tao Ma 2011-07-11 1824 ext4_grpblk_t start,
b3d4c2b10b68d2 Tao Ma 2011-07-11 1825 ext4_grpblk_t len),
b3d4c2b10b68d2 Tao Ma 2011-07-11 1826
b3d4c2b10b68d2 Tao Ma 2011-07-11 1827 TP_ARGS(sb, group, start, len)
b3d4c2b10b68d2 Tao Ma 2011-07-11 1828 );
b3d4c2b10b68d2 Tao Ma 2011-07-11 1829
:::::: The code@line 1820 was first introduced by commit
:::::: b3d4c2b10b68d205d3eb1b5c17dcb4649a502798 ext4: Add new ext4 trim tracepoints
:::::: TO: Tao Ma <boyu.mt@taobao.com>
:::::: CC: Theodore Ts'o <tytso@mit.edu>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-07-05 4:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202207051222.G2bplCnH-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.