From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [koverstreet-bcachefs:bcachefs-rebalance_v2 518/799] fs/bcachefs/init/chardev.c:249 bch2_ioctl_disk_remove() warn: 'ca' can also be NULL
Date: Thu, 14 May 2026 19:21:49 +0800 [thread overview]
Message-ID: <202605141930.GaeWbclM-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Kent Overstreet <kent.overstreet@linux.dev>
tree: https://github.com/koverstreet/bcachefs bcachefs-rebalance_v2
head: d4b3d00447faf8d4d95db47e3902e4ca4db8fbdc
commit: 383cf0dacfb4922419e7d38a3c22766d62fddc05 [518/799] bcachefs: more __free() conversion
:::::: branch date: 6 months ago
:::::: commit date: 7 months ago
config: i386-randconfig-141-20260514 (https://download.01.org/0day-ci/archive/20260514/202605141930.GaeWbclM-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch: v0.5.0-9185-gbcc58b9c
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@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202605141930.GaeWbclM-lkp@intel.com/
New smatch warnings:
fs/bcachefs/init/chardev.c:249 bch2_ioctl_disk_remove() warn: 'ca' can also be NULL
Old smatch warnings:
fs/bcachefs/init/chardev.c:557 bch2_ioctl_query_accounting() warn: potential user controlled sizeof overflow 'arg.accounting_u64s * 8' '0-u32max * 8'
vim +/ca +249 fs/bcachefs/init/chardev.c
ebb0fa27bb872bf fs/bcachefs/chardev.c Kent Overstreet 2025-08-18 229
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 230 static long bch2_ioctl_disk_remove(struct bch_fs *c, struct bch_ioctl_disk arg)
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 231 {
a515d0a50c6e8bb fs/bcachefs/chardev.c Tobias Geerinckx-Rice 2021-07-04 232 if (!capable(CAP_SYS_ADMIN))
a515d0a50c6e8bb fs/bcachefs/chardev.c Tobias Geerinckx-Rice 2021-07-04 233 return -EPERM;
a515d0a50c6e8bb fs/bcachefs/chardev.c Tobias Geerinckx-Rice 2021-07-04 234
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 235 if ((arg.flags & ~(BCH_FORCE_IF_DATA_LOST|
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 236 BCH_FORCE_IF_METADATA_LOST|
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 237 BCH_FORCE_IF_DEGRADED|
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 238 BCH_BY_INDEX)) ||
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 239 arg.pad)
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 240 return -EINVAL;
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 241
635c5791582a65e fs/bcachefs/chardev.c Kent Overstreet 2025-07-14 242 struct bch_dev *ca = bch2_device_lookup(c, arg.dev, arg.flags);
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 243 if (IS_ERR(ca))
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 244 return PTR_ERR(ca);
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 245
c72d1fe6d352961 fs/bcachefs/chardev.c Kent Overstreet 2025-08-18 246 CLASS(printbuf, err)();
c72d1fe6d352961 fs/bcachefs/chardev.c Kent Overstreet 2025-08-18 247 int ret = bch2_dev_remove(c, ca, arg.flags, &err);
c72d1fe6d352961 fs/bcachefs/chardev.c Kent Overstreet 2025-08-18 248 if (ret)
c72d1fe6d352961 fs/bcachefs/chardev.c Kent Overstreet 2025-08-18 @249 bch_err(ca, "%s", err.buf);
c72d1fe6d352961 fs/bcachefs/chardev.c Kent Overstreet 2025-08-18 250 return ret;
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 251 }
1c6fdbd8f2465dd fs/bcachefs/chardev.c Kent Overstreet 2017-03-16 252
:::::: The code at line 249 was first introduced by commit
:::::: c72d1fe6d3529612bb93391e29c5658acdf0e568 bcachefs: Plumb a printbuf for error strings through ioctls
:::::: TO: Kent Overstreet <kent.overstreet@linux.dev>
:::::: CC: Kent Overstreet <kent.overstreet@linux.dev>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-05-14 11:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 11:21 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-01-26 14:49 [koverstreet-bcachefs:bcachefs-rebalance_v2 518/799] fs/bcachefs/init/chardev.c:249 bch2_ioctl_disk_remove() warn: 'ca' can also be NULL kernel test robot
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=202605141930.GaeWbclM-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/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.