0f5bb0cfb0b40a31d2fe146ecbef5727690fa547 is the first bad commit commit 0f5bb0cfb0b40a31d2fe146ecbef5727690fa547 Author: David Laight Date: Wed Nov 19 22:41:26 2025 +0000 fs: use min() or umin() instead of min_t() min_t(unsigned int, a, b) casts an 'unsigned long' to 'unsigned int'. Use min(a, b) instead as it promotes any 'unsigned int' to 'unsigned long' and so cannot discard significant bits. A couple of places need umin() because of loops like: nfolios = DIV_ROUND_UP(ret + start, PAGE_SIZE); for (i = 0; i < nfolios; i++) { struct folio *folio = page_folio(pages[i]); ... unsigned int len = umin(ret, PAGE_SIZE - start); ... ret -= len; ... } where the compiler doesn't track things well enough to know that 'ret' is never negative. The alternate loop: for (i = 0; ret > 0; i++) { struct folio *folio = page_folio(pages[i]); ... unsigned int len = min(ret, PAGE_SIZE - start); ... ret -= len; ... } would be equivalent and doesn't need 'nfolios'. Most of the 'unsigned long' actually come from PAGE_SIZE. Detected by an extra check added to min_t(). Signed-off-by: David Laight Link: https://patch.msgid.link/20251119224140.8616-31-david.laight.linux@gmail.com Signed-off-by: Christian Brauner fs/buffer.c | 2 +- fs/exec.c | 2 +- fs/ext4/mballoc.c | 3 +-- fs/ext4/resize.c | 2 +- fs/ext4/super.c | 2 +- fs/fat/dir.c | 4 ++-- fs/fat/file.c | 3 +-- fs/fuse/dev.c | 2 +- fs/fuse/file.c | 8 +++----- fs/splice.c | 2 +- 10 files changed, 13 insertions(+), 17 deletions(-)