From: kernel test robot <lkp@intel.com>
To: Ding Feng <dingf3ng@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev,
Christian Brauner <christianvanbrauner@gmail.com>,
Christian Brauner <brauner@kernel.org>
Subject: [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
Date: Thu, 19 Nov 2026 02:58:40 +0100 [thread overview]
Message-ID: <20261119025208.RuJOL5HF-lkp@intel.com> (raw)
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
reply other threads:[~2026-11-19 1:58 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=20261119025208.RuJOL5HF-lkp@intel.com \
--to=lkp@intel.com \
--cc=brauner@kernel.org \
--cc=christianvanbrauner@gmail.com \
--cc=dingf3ng@gmail.com \
--cc=oe-kbuild-all@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.