* [brauner-github:vfs-7.5.misc 29/29] fs/read_write.c:1723:38: warning: result of comparison of constant 9223372036854775807 with expression of type 'unsigned long' is always true
@ 2026-11-19 1:58 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-19 1:58 UTC (permalink / raw)
To: Ding Feng; +Cc: oe-kbuild-all, Christian Brauner, Christian Brauner
tree: https://github.com/brauner/linux.git vfs-7.5.misc
head: bc0dc43794630fd5c38369d19e91477d2a197328
commit: bc0dc43794630fd5c38369d19e91477d2a197328 [29/29] fs: ignore RLIMIT_FSIZE above LLONG_MAX in generic_write_check_limits()
config: mips-randconfig-2200-20261119 (https://download.01.org/0day-ci/archive/20261119/20261119025208.RuJOL5HF-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 51d7f08b16b68285b1a400f413215b69f07a65e3)
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261119/20261119025208.RuJOL5HF-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/20261119025208.RuJOL5HF-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/read_write.c:1723:38: warning: result of comparison of constant 9223372036854775807 with expression of type 'unsigned long' is always true [-Wtautological-constant-out-of-range-compare]
1723 | if (limit != RLIM_INFINITY && limit <= LLONG_MAX) {
| ~~~~~ ^ ~~~~~~~~~
1 warning generated.
vim +1723 fs/read_write.c
1710
1711 /*
1712 * Don't operate on ranges the page cache doesn't support, and don't exceed the
1713 * LFS limits. If pos is under the limit it becomes a short access. If it
1714 * exceeds the limit we return -EFBIG.
1715 */
1716 int generic_write_check_limits(struct file *file, loff_t pos, loff_t *count)
1717 {
1718 struct inode *inode = file->f_mapping->host;
1719 loff_t max_size = inode->i_sb->s_maxbytes;
1720 unsigned long limit = rlimit(RLIMIT_FSIZE);
1721
1722 /* No file position reaches a limit above LLONG_MAX. */
> 1723 if (limit != RLIM_INFINITY && limit <= LLONG_MAX) {
1724 if (pos >= (loff_t)limit) {
1725 send_sig(SIGXFSZ, current, 0);
1726 return -EFBIG;
1727 }
1728 *count = min(*count, (loff_t)limit - pos);
1729 }
1730
1731 if (!(file->f_flags & O_LARGEFILE))
1732 max_size = MAX_NON_LFS;
1733
1734 if (unlikely(pos >= max_size))
1735 return -EFBIG;
1736
1737 *count = min(*count, max_size - pos);
1738
1739 return 0;
1740 }
1741 EXPORT_SYMBOL_GPL(generic_write_check_limits);
1742
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-19 1:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 1:58 [brauner-github:vfs-7.5.misc 29/29] fs/read_write.c:1723:38: warning: result of comparison of constant 9223372036854775807 with expression of type 'unsigned long' is always true kernel test robot
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.