Linux block layer
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yingjie Wang <x-professor@outlook.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"dlemoal@kernel.org" <dlemoal@kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] null_blk: reject device size overflow
Date: Fri, 27 Nov 2026 00:55:23 +0800	[thread overview]
Message-ID: <20261127004636.Zw6bu9Dk-lkp@intel.com> (raw)
In-Reply-To: <20261126074748.1076774-2-x-professor@outlook.com>

Hi Yingjie,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 5a29cfaf51105039d156dd8a61d2783e8b653667]

url:    https://github.com/intel-lab-lkp/linux/commits/Yingjie-Wang/null_blk-reject-device-size-overflow/20261126-074752
base:   5a29cfaf51105039d156dd8a61d2783e8b653667
patch link:    https://lore.kernel.org/r/20261126074748.1076774-2-x-professor%40outlook.com
patch subject: [PATCH v2 1/3] null_blk: reject device size overflow
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20261127/20261127004636.Zw6bu9Dk-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project fb29ca8163c3309160711e5a14eb46bc6d4fdad2)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261127/20261127004636.Zw6bu9Dk-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261127004636.Zw6bu9Dk-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/block/null_blk/main.c:1896:16: warning: result of comparison of constant 8796093022207 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
    1896 |         if (dev->size > LLONG_MAX / SZ_1M) {
         |             ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +1896 drivers/block/null_blk/main.c

  1893	
  1894	static int null_validate_conf(struct nullb_device *dev)
  1895	{
> 1896		if (dev->size > LLONG_MAX / SZ_1M) {
  1897			pr_err("Device size is too large\n");
  1898			return -EINVAL;
  1899		}
  1900	
  1901		if (dev->queue_mode == NULL_Q_RQ) {
  1902			pr_err("legacy IO path is no longer available\n");
  1903			return -EINVAL;
  1904		}
  1905		if (dev->queue_mode == NULL_Q_BIO) {
  1906			pr_err("BIO-based IO path is no longer available, using blk-mq instead.\n");
  1907			dev->queue_mode = NULL_Q_MQ;
  1908		}
  1909	
  1910		if (dev->use_per_node_hctx) {
  1911			if (dev->submit_queues != nr_online_nodes)
  1912				dev->submit_queues = nr_online_nodes;
  1913		} else if (dev->submit_queues > nr_cpu_ids)
  1914			dev->submit_queues = nr_cpu_ids;
  1915		else if (dev->submit_queues == 0)
  1916			dev->submit_queues = 1;
  1917		dev->prev_submit_queues = dev->submit_queues;
  1918	
  1919		if (dev->poll_queues > g_poll_queues)
  1920			dev->poll_queues = g_poll_queues;
  1921		dev->prev_poll_queues = dev->poll_queues;
  1922		dev->irqmode = min_t(unsigned int, dev->irqmode, NULL_IRQ_TIMER);
  1923	
  1924		/* Do memory allocation, so set blocking */
  1925		if (dev->memory_backed)
  1926			dev->blocking = true;
  1927		else /* cache is meaningless */
  1928			dev->cache_size = 0;
  1929		dev->cache_size = min_t(unsigned long, ULONG_MAX / 1024 / 1024,
  1930							dev->cache_size);
  1931		dev->mbps = min_t(unsigned int, 1024 * 40, dev->mbps);
  1932	
  1933		if (dev->zoned &&
  1934		    (!dev->zone_size || !is_power_of_2(dev->zone_size))) {
  1935			pr_err("zone_size must be power-of-two\n");
  1936			return -EINVAL;
  1937		}
  1938	
  1939		return 0;
  1940	}
  1941	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2026-11-26 16:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  7:47 [PATCH v2 0/3] null_blk: validate configfs values before power-on Yingjie Wang
2026-11-26  7:47 ` [PATCH v2 1/3] null_blk: reject device size overflow Yingjie Wang
2026-11-26  7:56   ` Damien Le Moal
2026-11-26 16:55   ` kernel test robot [this message]
2026-11-26  7:47 ` [PATCH v2 2/3] null_blk: reject zone counts that overflow unsigned int Yingjie Wang
2026-11-26  7:58   ` Damien Le Moal
2026-11-26  7:47 ` [PATCH v2 3/3] null_blk: validate the configfs home_node attribute Yingjie Wang

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=20261127004636.Zw6bu9Dk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=x-professor@outlook.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox