]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs: fuse: fix max() of incompatible types
authorArnd Bergmann <arnd@arndb.de>
Tue, 23 Dec 2025 21:54:03 +0000 (22:54 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Feb 2026 23:19:43 +0000 (15:19 -0800)
commitb29a7a8eee6a1ca974aaf053c0ffed1173d279c2
tree6d4dc18f8ecb6e95f8c7f5145b11e8fde11af6cc
parent9e355113f02be17db573d579515dee63621b7c8b
fs: fuse: fix max() of incompatible types

The 'max()' value of a 'long long' and an 'unsigned int' is problematic
if the former is negative:

In function 'fuse_wr_pages',
    inlined from 'fuse_perform_write' at fs/fuse/file.c:1347:27:
include/linux/compiler_types.h:652:45: error: call to '__compiletime_assert_390' declared with attribute error: min(((pos + len - 1) >> 12) - (pos >> 12) + 1, max_pages) signedness error
  652 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |                                             ^

Use a temporary variable to make it clearer what is going on here.

Fixes: 0f5bb0cfb0b4 ("fs: use min() or umin() instead of min_t()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fuse/file.c