* Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
2025-12-20 11:02 ` [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative() Vincent Mailhol
@ 2025-12-20 12:52 ` Nicolas Schier
2025-12-22 10:03 ` kernel test robot
` (4 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Nicolas Schier @ 2025-12-20 12:52 UTC (permalink / raw)
To: Vincent Mailhol
Cc: Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Chris Mason, David Sterba, Kees Cook,
Gustavo A. R. Silva, Linus Torvalds, linux-kbuild, linux-sparse,
linux-kernel, llvm, dri-devel, linux-btrfs, linux-hardening
On Sat, Dec 20, 2025 at 12:02:21PM +0100, Vincent Mailhol wrote:
> The is_non_negative() and is_negative() function-like macros just
> exist as a workaround to silence the -Wtype-limits warning. Now that
> this warning is disabled, those two macros have lost their raison
> d'être. Remove them.
>
> This reverts commit dc7fe518b049 ("overflow: Fix -Wtype-limits
> compilation warnings").
>
> Suggested-by: Nicolas Schier <nsc@kernel.org>
> Link: https://lore.kernel.org/all/aUT_yWin_xslnOFh@derry.ads.avm.de
> Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
> ---
> Changelog:
>
> v1 -> v2: new patch
> ---
> include/linux/overflow.h | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
Thanks!
Reviewed-by: Nicolas Schier <nsc@kernel.org>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
2025-12-20 11:02 ` [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative() Vincent Mailhol
2025-12-20 12:52 ` Nicolas Schier
@ 2025-12-22 10:03 ` kernel test robot
2025-12-22 18:39 ` Vincent Mailhol
2025-12-22 19:55 ` kernel test robot
` (3 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: kernel test robot @ 2025-12-22 10:03 UTC (permalink / raw)
To: Vincent Mailhol, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Chris Mason, David Sterba, Kees Cook, Gustavo A. R. Silva
Cc: oe-kbuild-all, linux-kbuild, linux-sparse, linux-kernel, llvm,
dri-devel, linux-btrfs, linux-hardening, Vincent Mailhol
Hi Vincent,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 3e7f562e20ee87a25e104ef4fce557d39d62fa85]
url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/kbuild-remove-gcc-s-Wtype-limits/20251220-190509
base: 3e7f562e20ee87a25e104ef4fce557d39d62fa85
patch link: https://lore.kernel.org/r/20251220-remove_wtype-limits-v3-3-24b170af700e%40kernel.org
patch subject: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
config: x86_64-randconfig-161-20251222 (https://download.01.org/0day-ci/archive/20251222/202512221735.mRV4BZqB-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512221735.mRV4BZqB-lkp@intel.com/
smatch warnings:
fs/libfs.c:1628 generic_check_addressable() warn: unsigned '*_d' is never less than zero.
fs/libfs.c:1628 generic_check_addressable() warn: unsigned '_a' is never less than zero.
mm/vmalloc.c:4708 remap_vmalloc_range_partial() warn: unsigned '*_d' is never less than zero.
mm/vmalloc.c:4708 remap_vmalloc_range_partial() warn: unsigned '_a' is never less than zero.
vim +1628 fs/libfs.c
1b061d9247f71c Christoph Hellwig 2010-05-26 1613
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1614 /**
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1615 * generic_check_addressable - Check addressability of file system
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1616 * @blocksize_bits: log of file system block size
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1617 * @num_blocks: number of blocks in file system
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1618 *
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1619 * Determine whether a file system with @num_blocks blocks (and a
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1620 * block size of 2**@blocksize_bits) is addressable by the sector_t
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1621 * and page cache of the system. Return 0 if so and -EFBIG otherwise.
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1622 */
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1623 int generic_check_addressable(unsigned blocksize_bits, u64 num_blocks)
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1624 {
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1625 u64 last_fs_block = num_blocks - 1;
25050181b61aa0 Pankaj Raghav 2025-06-30 1626 u64 last_fs_page, max_bytes;
25050181b61aa0 Pankaj Raghav 2025-06-30 1627
25050181b61aa0 Pankaj Raghav 2025-06-30 @1628 if (check_shl_overflow(num_blocks, blocksize_bits, &max_bytes))
25050181b61aa0 Pankaj Raghav 2025-06-30 1629 return -EFBIG;
25050181b61aa0 Pankaj Raghav 2025-06-30 1630
25050181b61aa0 Pankaj Raghav 2025-06-30 1631 last_fs_page = (max_bytes >> PAGE_SHIFT) - 1;
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1632
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1633 if (unlikely(num_blocks == 0))
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1634 return 0;
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1635
25050181b61aa0 Pankaj Raghav 2025-06-30 1636 if (blocksize_bits < 9)
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1637 return -EINVAL;
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1638
a33f13efe05192 Joel Becker 2010-08-16 1639 if ((last_fs_block > (sector_t)(~0ULL) >> (blocksize_bits - 9)) ||
a33f13efe05192 Joel Becker 2010-08-16 1640 (last_fs_page > (pgoff_t)(~0ULL))) {
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1641 return -EFBIG;
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1642 }
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1643 return 0;
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1644 }
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1645 EXPORT_SYMBOL(generic_check_addressable);
30ca22c70e3ef0 Patrick J. LoPresti 2010-07-22 1646
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
2025-12-22 10:03 ` kernel test robot
@ 2025-12-22 18:39 ` Vincent Mailhol
0 siblings, 0 replies; 12+ messages in thread
From: Vincent Mailhol @ 2025-12-22 18:39 UTC (permalink / raw)
To: kernel test robot, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Chris Mason, David Sterba, Kees Cook, Gustavo A. R. Silva
Cc: oe-kbuild-all, linux-kbuild, linux-sparse, linux-kernel, llvm,
dri-devel, linux-btrfs, linux-hardening
On 22/12/2025 at 11:03, kernel test robot wrote:
> Hi Vincent,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on 3e7f562e20ee87a25e104ef4fce557d39d62fa85]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/kbuild-remove-gcc-s-Wtype-limits/20251220-190509
> base: 3e7f562e20ee87a25e104ef4fce557d39d62fa85
> patch link: https://lore.kernel.org/r/20251220-remove_wtype-limits-v3-3-24b170af700e%40kernel.org
> patch subject: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
> config: x86_64-randconfig-161-20251222 (https://download.01.org/0day-ci/archive/20251222/202512221735.mRV4BZqB-lkp@intel.com/config)
> compiler: gcc-14 (Debian 14.2.0-19) 14.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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202512221735.mRV4BZqB-lkp@intel.com/
>
> smatch warnings:
> fs/libfs.c:1628 generic_check_addressable() warn: unsigned '*_d' is never less than zero.
> fs/libfs.c:1628 generic_check_addressable() warn: unsigned '_a' is never less than zero.
> mm/vmalloc.c:4708 remap_vmalloc_range_partial() warn: unsigned '*_d' is never less than zero.
> mm/vmalloc.c:4708 remap_vmalloc_range_partial() warn: unsigned '_a' is never less than zero.
So smatch is not able to distinguish when the comparison comes from
a macro expansion.
Can this warning be ignored? Or should I remove this 3rd patch from
the series (and go back to v1)? My choice would be to ignore this
warning.
Yours sincerely,
Vincent Mailhol
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
2025-12-20 11:02 ` [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative() Vincent Mailhol
2025-12-20 12:52 ` Nicolas Schier
2025-12-22 10:03 ` kernel test robot
@ 2025-12-22 19:55 ` kernel test robot
2025-12-25 6:04 ` kernel test robot
` (2 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2025-12-22 19:55 UTC (permalink / raw)
To: Vincent Mailhol, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Chris Mason, David Sterba, Kees Cook, Gustavo A. R. Silva
Cc: oe-kbuild-all, linux-kbuild, linux-sparse, linux-kernel, llvm,
dri-devel, linux-btrfs, linux-hardening, Vincent Mailhol
Hi Vincent,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 3e7f562e20ee87a25e104ef4fce557d39d62fa85]
url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/kbuild-remove-gcc-s-Wtype-limits/20251220-190509
base: 3e7f562e20ee87a25e104ef4fce557d39d62fa85
patch link: https://lore.kernel.org/r/20251220-remove_wtype-limits-v3-3-24b170af700e%40kernel.org
patch subject: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
config: i386-randconfig-141-20251222 (https://download.01.org/0day-ci/archive/20251223/202512230342.Lgha2HGH-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512230342.Lgha2HGH-lkp@intel.com/
New smatch warnings:
block/blk-settings.c:702 blk_stack_atomic_writes_chunk_sectors() warn: unsigned '*_d' is never less than zero.
block/blk-settings.c:702 blk_stack_atomic_writes_chunk_sectors() warn: unsigned '_a' is never less than zero.
drivers/nvme/host/core.c:3353 nvme_mps_to_sectors() warn: unsigned '*_d' is never less than zero.
drivers/nvme/host/core.c:3353 nvme_mps_to_sectors() warn: unsigned '_a' is never less than zero.
Old smatch warnings:
drivers/nvme/host/core.c:5032 nvme_free_cels() warn: iterator 'i' not incremented
vim +702 block/blk-settings.c
d7f36dc446e894 John Garry 2024-11-18 689
63d092d1c1b1f7 John Garry 2025-07-11 690 static void blk_stack_atomic_writes_chunk_sectors(struct queue_limits *t)
d7f36dc446e894 John Garry 2024-11-18 691 {
63d092d1c1b1f7 John Garry 2025-07-11 692 unsigned int chunk_bytes;
d7f36dc446e894 John Garry 2024-11-18 693
63d092d1c1b1f7 John Garry 2025-07-11 694 if (!t->chunk_sectors)
63d092d1c1b1f7 John Garry 2025-07-11 695 return;
63d092d1c1b1f7 John Garry 2025-07-11 696
63d092d1c1b1f7 John Garry 2025-07-11 697 /*
63d092d1c1b1f7 John Garry 2025-07-11 698 * If chunk sectors is so large that its value in bytes overflows
63d092d1c1b1f7 John Garry 2025-07-11 699 * UINT_MAX, then just shift it down so it definitely will fit.
63d092d1c1b1f7 John Garry 2025-07-11 700 * We don't support atomic writes of such a large size anyway.
63d092d1c1b1f7 John Garry 2025-07-11 701 */
63d092d1c1b1f7 John Garry 2025-07-11 @702 if (check_shl_overflow(t->chunk_sectors, SECTOR_SHIFT, &chunk_bytes))
63d092d1c1b1f7 John Garry 2025-07-11 703 chunk_bytes = t->chunk_sectors;
d7f36dc446e894 John Garry 2024-11-18 704
d7f36dc446e894 John Garry 2024-11-18 705 /*
d7f36dc446e894 John Garry 2024-11-18 706 * Find values for limits which work for chunk size.
d7f36dc446e894 John Garry 2024-11-18 707 * b->atomic_write_hw_unit_{min, max} may not be aligned with chunk
63d092d1c1b1f7 John Garry 2025-07-11 708 * size, as the chunk size is not restricted to a power-of-2.
d7f36dc446e894 John Garry 2024-11-18 709 * So we need to find highest power-of-2 which works for the chunk
d7f36dc446e894 John Garry 2024-11-18 710 * size.
63d092d1c1b1f7 John Garry 2025-07-11 711 * As an example scenario, we could have t->unit_max = 16K and
63d092d1c1b1f7 John Garry 2025-07-11 712 * t->chunk_sectors = 24KB. For this case, reduce t->unit_max to a
63d092d1c1b1f7 John Garry 2025-07-11 713 * value aligned with both limits, i.e. 8K in this example.
d7f36dc446e894 John Garry 2024-11-18 714 */
63d092d1c1b1f7 John Garry 2025-07-11 715 t->atomic_write_hw_unit_max = min(t->atomic_write_hw_unit_max,
63d092d1c1b1f7 John Garry 2025-07-11 716 max_pow_of_two_factor(chunk_bytes));
d7f36dc446e894 John Garry 2024-11-18 717
63d092d1c1b1f7 John Garry 2025-07-11 718 t->atomic_write_hw_unit_min = min(t->atomic_write_hw_unit_min,
d7f36dc446e894 John Garry 2024-11-18 719 t->atomic_write_hw_unit_max);
63d092d1c1b1f7 John Garry 2025-07-11 720 t->atomic_write_hw_max = min(t->atomic_write_hw_max, chunk_bytes);
63d092d1c1b1f7 John Garry 2025-07-11 721 }
d7f36dc446e894 John Garry 2024-11-18 722
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
2025-12-20 11:02 ` [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative() Vincent Mailhol
` (2 preceding siblings ...)
2025-12-22 19:55 ` kernel test robot
@ 2025-12-25 6:04 ` kernel test robot
2025-12-27 8:49 ` kernel test robot
2025-12-28 1:41 ` kernel test robot
5 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2025-12-25 6:04 UTC (permalink / raw)
To: Vincent Mailhol, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Chris Mason, David Sterba, Kees Cook, Gustavo A. R. Silva
Cc: oe-kbuild-all, linux-kbuild, linux-sparse, linux-kernel, llvm,
dri-devel, linux-btrfs, linux-hardening, Vincent Mailhol
Hi Vincent,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 3e7f562e20ee87a25e104ef4fce557d39d62fa85]
url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/kbuild-remove-gcc-s-Wtype-limits/20251220-190509
base: 3e7f562e20ee87a25e104ef4fce557d39d62fa85
patch link: https://lore.kernel.org/r/20251220-remove_wtype-limits-v3-3-24b170af700e%40kernel.org
patch subject: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
config: i386-randconfig-141-20251225 (https://download.01.org/0day-ci/archive/20251225/202512251340.UApIFw9R-lkp@intel.com/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512251340.UApIFw9R-lkp@intel.com/
smatch warnings:
drivers/md/dm-stripe.c:463 stripe_io_hints() warn: unsigned '*_d' is never less than zero.
drivers/md/dm-stripe.c:463 stripe_io_hints() warn: unsigned '_a' is never less than zero.
vim +463 drivers/md/dm-stripe.c
af4874e03ed82f Mike Snitzer 2009-06-22 454
40bea431274c24 Mike Snitzer 2009-09-04 455 static void stripe_io_hints(struct dm_target *ti,
40bea431274c24 Mike Snitzer 2009-09-04 456 struct queue_limits *limits)
40bea431274c24 Mike Snitzer 2009-09-04 457 {
40bea431274c24 Mike Snitzer 2009-09-04 458 struct stripe_c *sc = ti->private;
1071d560afb4c2 Mikulas Patocka 2025-08-11 459 unsigned int io_min, io_opt;
40bea431274c24 Mike Snitzer 2009-09-04 460
5fb9d4341b782a John Garry 2025-07-11 461 limits->chunk_sectors = sc->chunk_size;
1071d560afb4c2 Mikulas Patocka 2025-08-11 462
1071d560afb4c2 Mikulas Patocka 2025-08-11 @463 if (!check_shl_overflow(sc->chunk_size, SECTOR_SHIFT, &io_min) &&
1071d560afb4c2 Mikulas Patocka 2025-08-11 464 !check_mul_overflow(io_min, sc->stripes, &io_opt)) {
1071d560afb4c2 Mikulas Patocka 2025-08-11 465 limits->io_min = io_min;
1071d560afb4c2 Mikulas Patocka 2025-08-11 466 limits->io_opt = io_opt;
1071d560afb4c2 Mikulas Patocka 2025-08-11 467 }
40bea431274c24 Mike Snitzer 2009-09-04 468 }
40bea431274c24 Mike Snitzer 2009-09-04 469
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
2025-12-20 11:02 ` [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative() Vincent Mailhol
` (3 preceding siblings ...)
2025-12-25 6:04 ` kernel test robot
@ 2025-12-27 8:49 ` kernel test robot
2025-12-28 1:41 ` kernel test robot
5 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2025-12-27 8:49 UTC (permalink / raw)
To: Vincent Mailhol, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Chris Mason, David Sterba, Kees Cook, Gustavo A. R. Silva
Cc: oe-kbuild-all, linux-kbuild, linux-sparse, linux-kernel, llvm,
dri-devel, linux-btrfs, linux-hardening, Vincent Mailhol
Hi Vincent,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 3e7f562e20ee87a25e104ef4fce557d39d62fa85]
url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/kbuild-remove-gcc-s-Wtype-limits/20251220-190509
base: 3e7f562e20ee87a25e104ef4fce557d39d62fa85
patch link: https://lore.kernel.org/r/20251220-remove_wtype-limits-v3-3-24b170af700e%40kernel.org
patch subject: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
config: sparc-randconfig-r072-20251227 (https://download.01.org/0day-ci/archive/20251227/202512271618.33YepxDC-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 15.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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512271618.33YepxDC-lkp@intel.com/
smatch warnings:
drivers/block/nbd.c:1612 __nbd_ioctl() warn: unsigned '_a' is never less than zero.
vim +/_a +1612 drivers/block/nbd.c
55313e92bd17a87 Mike Christie 2019-08-13 1591
9442b739207aab6 Josef Bacik 2017-02-07 1592 /* Must be called with config_lock held */
9442b739207aab6 Josef Bacik 2017-02-07 1593 static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
9442b739207aab6 Josef Bacik 2017-02-07 1594 unsigned int cmd, unsigned long arg)
9442b739207aab6 Josef Bacik 2017-02-07 1595 {
5ea8d10802ec4c1 Josef Bacik 2017-04-06 1596 struct nbd_config *config = nbd->config;
fad7cd3310db309 Baokun Li 2021-08-04 1597 loff_t bytesize;
5ea8d10802ec4c1 Josef Bacik 2017-04-06 1598
9442b739207aab6 Josef Bacik 2017-02-07 1599 switch (cmd) {
9442b739207aab6 Josef Bacik 2017-02-07 1600 case NBD_DISCONNECT:
29eaadc0364943b Josef Bacik 2017-04-06 1601 return nbd_disconnect(nbd);
9442b739207aab6 Josef Bacik 2017-02-07 1602 case NBD_CLEAR_SOCK:
0c1c9a27ce909e3 Christoph Hellwig 2023-08-11 1603 nbd_clear_sock_ioctl(nbd);
29eaadc0364943b Josef Bacik 2017-04-06 1604 return 0;
9442b739207aab6 Josef Bacik 2017-02-07 1605 case NBD_SET_SOCK:
e46c7287b1c2768 Josef Bacik 2017-04-06 1606 return nbd_add_socket(nbd, arg, false);
9442b739207aab6 Josef Bacik 2017-02-07 1607 case NBD_SET_BLKSIZE:
dcbddf541f18e36 Christoph Hellwig 2020-11-16 1608 return nbd_set_size(nbd, config->bytesize, arg);
9442b739207aab6 Josef Bacik 2017-02-07 1609 case NBD_SET_SIZE:
41e76c6a3c83c85 Nick Desaulniers 2021-09-20 1610 return nbd_set_size(nbd, arg, nbd_blksize(config));
9442b739207aab6 Josef Bacik 2017-02-07 1611 case NBD_SET_SIZE_BLOCKS:
41e76c6a3c83c85 Nick Desaulniers 2021-09-20 @1612 if (check_shl_overflow(arg, config->blksize_bits, &bytesize))
fad7cd3310db309 Baokun Li 2021-08-04 1613 return -EINVAL;
41e76c6a3c83c85 Nick Desaulniers 2021-09-20 1614 return nbd_set_size(nbd, bytesize, nbd_blksize(config));
9442b739207aab6 Josef Bacik 2017-02-07 1615 case NBD_SET_TIMEOUT:
55313e92bd17a87 Mike Christie 2019-08-13 1616 nbd_set_cmd_timeout(nbd, arg);
9442b739207aab6 Josef Bacik 2017-02-07 1617 return 0;
9442b739207aab6 Josef Bacik 2017-02-07 1618
9442b739207aab6 Josef Bacik 2017-02-07 1619 case NBD_SET_FLAGS:
5ea8d10802ec4c1 Josef Bacik 2017-04-06 1620 config->flags = arg;
9442b739207aab6 Josef Bacik 2017-02-07 1621 return 0;
9442b739207aab6 Josef Bacik 2017-02-07 1622 case NBD_DO_IT:
2a852a693f8839b Christoph Hellwig 2022-03-30 1623 return nbd_start_device_ioctl(nbd);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1624 case NBD_CLEAR_QUE:
4b2f0260c74324a Herbert Xu 2006-01-06 1625 /*
4b2f0260c74324a Herbert Xu 2006-01-06 1626 * This is for compatibility only. The queue is always cleared
4b2f0260c74324a Herbert Xu 2006-01-06 1627 * by NBD_DO_IT or NBD_CLEAR_SOCK.
4b2f0260c74324a Herbert Xu 2006-01-06 1628 */
^1da177e4c3f415 Linus Torvalds 2005-04-16 1629 return 0;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1630 case NBD_PRINT_DEBUG:
fd8383fd88a2fd8 Josef Bacik 2016-09-08 1631 /*
fd8383fd88a2fd8 Josef Bacik 2016-09-08 1632 * For compatibility only, we no longer keep a list of
fd8383fd88a2fd8 Josef Bacik 2016-09-08 1633 * outstanding requests.
fd8383fd88a2fd8 Josef Bacik 2016-09-08 1634 */
^1da177e4c3f415 Linus Torvalds 2005-04-16 1635 return 0;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1636 }
1a2ad21128bb4eb Pavel Machek 2009-04-02 1637 return -ENOTTY;
1a2ad21128bb4eb Pavel Machek 2009-04-02 1638 }
1a2ad21128bb4eb Pavel Machek 2009-04-02 1639
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
2025-12-20 11:02 ` [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative() Vincent Mailhol
` (4 preceding siblings ...)
2025-12-27 8:49 ` kernel test robot
@ 2025-12-28 1:41 ` kernel test robot
5 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2025-12-28 1:41 UTC (permalink / raw)
To: Vincent Mailhol, Nathan Chancellor, Nicolas Schier,
Nick Desaulniers, Bill Wendling, Justin Stitt, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Chris Mason, David Sterba, Kees Cook, Gustavo A. R. Silva
Cc: oe-kbuild-all, linux-kbuild, linux-sparse, linux-kernel, llvm,
dri-devel, linux-btrfs, linux-hardening, Vincent Mailhol
Hi Vincent,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 3e7f562e20ee87a25e104ef4fce557d39d62fa85]
url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/kbuild-remove-gcc-s-Wtype-limits/20251220-190509
base: 3e7f562e20ee87a25e104ef4fce557d39d62fa85
patch link: https://lore.kernel.org/r/20251220-remove_wtype-limits-v3-3-24b170af700e%40kernel.org
patch subject: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()
config: arm-randconfig-r071-20251224 (https://download.01.org/0day-ci/archive/20251228/202512280906.wt7UNpya-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 8.5.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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512280906.wt7UNpya-lkp@intel.com/
smatch warnings:
fs/xfs/xfs_mount.c:144 xfs_sb_validate_fsb_count() warn: unsigned '*_d' is never less than zero.
fs/xfs/xfs_mount.c:144 xfs_sb_validate_fsb_count() warn: unsigned '_a' is never less than zero.
vim +144 fs/xfs/xfs_mount.c
27174203f570b9 Christoph Hellwig 2009-03-30 130
4cc929ee305c69 Nathan Scott 2007-05-14 131 /*
4cc929ee305c69 Nathan Scott 2007-05-14 132 * Check size of device based on the (data/realtime) block count.
4cc929ee305c69 Nathan Scott 2007-05-14 133 * Note: this check is used by the growfs code as well as mount.
4cc929ee305c69 Nathan Scott 2007-05-14 134 */
4cc929ee305c69 Nathan Scott 2007-05-14 135 int
4cc929ee305c69 Nathan Scott 2007-05-14 136 xfs_sb_validate_fsb_count(
4cc929ee305c69 Nathan Scott 2007-05-14 137 xfs_sb_t *sbp,
c8ce540db5f67d Darrick J. Wong 2017-06-16 138 uint64_t nblocks)
4cc929ee305c69 Nathan Scott 2007-05-14 139 {
cebf9dacd5c3ce Pankaj Raghav 2024-08-22 140 uint64_t max_bytes;
cebf9dacd5c3ce Pankaj Raghav 2024-08-22 141
4cc929ee305c69 Nathan Scott 2007-05-14 142 ASSERT(sbp->sb_blocklog >= BBSHIFT);
4cc929ee305c69 Nathan Scott 2007-05-14 143
cebf9dacd5c3ce Pankaj Raghav 2024-08-22 @144 if (check_shl_overflow(nblocks, sbp->sb_blocklog, &max_bytes))
cebf9dacd5c3ce Pankaj Raghav 2024-08-22 145 return -EFBIG;
cebf9dacd5c3ce Pankaj Raghav 2024-08-22 146
d5cf09baced0ef Christoph Hellwig 2014-07-30 147 /* Limited by ULONG_MAX of page cache index */
cebf9dacd5c3ce Pankaj Raghav 2024-08-22 148 if (max_bytes >> PAGE_SHIFT > ULONG_MAX)
2451337dd04390 Dave Chinner 2014-06-25 149 return -EFBIG;
4cc929ee305c69 Nathan Scott 2007-05-14 150 return 0;
4cc929ee305c69 Nathan Scott 2007-05-14 151 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 152
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread