]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs: Add uoff_t
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 23 Nov 2025 22:05:15 +0000 (22:05 +0000)
committerChristian Brauner <brauner@kernel.org>
Tue, 25 Nov 2025 09:07:42 +0000 (10:07 +0100)
commit37d369fa97cc0774ea4eab726d16bcb5fbe3a104
tree6b5548ec93f0b63d897e3fbcc7f6d3b1a418f54c
parenta77a59592febd4179efa6b59f2ef5bdfe9a5b895
fs: Add uoff_t

In a recent commit, I inadvertently changed a comparison from being an
unsigned comparison (on 64-bit systems) to being a signed comparison
(which it had always been on 32-bit systems).  This led to a sporadic
fstests failure.

To make sure this comparison is always unsigned, introduce a new type,
uoff_t which is the unsigned version of loff_t.  Generally file sizes
are restricted to being a signed integer, but in these two places it is
convenient to pass -1 to indicate "up to the end of the file".

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://patch.msgid.link/20251123220518.1447261-1-willy@infradead.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/mm.h
include/linux/shmem_fs.h
include/linux/types.h
include/uapi/asm-generic/posix_types.h
mm/shmem.c
mm/truncate.c