History log of /linux/fs/tests/fdtable_kunit.c (Results 1 – 4 of 4)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# a1d4585b 20-Oct-2026 Linus Torvalds <torvalds@linux-foundation.org>

Merge tag 'vfs-7.4-rc1.file' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull file table updates from Christian Brauner:
"This annotates struct fdtable's fd array with __counted_by_ptr

Merge tag 'vfs-7.4-rc1.file' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull file table updates from Christian Brauner:
"This annotates struct fdtable's fd array with __counted_by_ptr so
KASAN and the fortified functions can bounds check it against max_fds
and adds a KUnit suite for fdtable. A follow-up uses __struct_size()
in the test since sparse doesn't know __builtin_dynamic_object_size().

FD_PREPARE() is simplified. It was built as an ACQUIRE-style guard on
infrastructure that was never needed. The ACQUIRE machinery and
CLASS_INIT() go away, the variable is declared with __cleanup()
directly, struct fd_prepare loses its err field since the fd either
holds the descriptor or the error, and callers get a const pointer to
the guard behind a UNIQUE_ID() name so they can't shadow it. Code
generation is identical"

* tag 'vfs-7.4-rc1.file' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
file: make struct fd_prepare const and kill its err field
cleanup: remove CLASS_INIT()
file: declare the FD_PREPARE() variable with __cleanup() directly
file: simplify FD_PREPARE()
vfs: use __struct_size() in the fdtable KUnit test
vfs: Add KUnit tests for fdtable
vfs: Annotate struct fdtable's fd field with __counted_by_ptr

show more ...


Revision tags: v7.3, v7.3-rc7, v7.3-rc6, v7.3-rc5, v7.3-rc4, v7.3-rc3
# 07d35cec 11-Sep-2026 Christian Brauner <brauner@kernel.org>

vfs: use __struct_size() in the fdtable KUnit test

sparse doesn't know __builtin_dynamic_object_size() and so the two size
checks in the fdtable test fall apart on every config where the compiler
ha

vfs: use __struct_size() in the fdtable KUnit test

sparse doesn't know __builtin_dynamic_object_size() and so the two size
checks in the fdtable test fall apart on every config where the compiler
has __counted_by_ptr:

fs/tests/fdtable_kunit.c:25:9: sparse: undefined identifier '__builtin_dynamic_object_size'
fs/tests/fdtable_kunit.c:25:9: sparse: incompatible types for operation (==):

Use __struct_size() instead. Every compiler that has __counted_by_ptr also
has __builtin_dynamic_object_size() so it expands to the same builtin and
the test checks the same thing. sparse lacks the builtin and gets the
__builtin_object_size() fallback which it does understand.

Fixes: 501cbbd276b7 ("vfs: Add KUnit tests for fdtable")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609111337.fBSfTIpR-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202609111828.SjerhPyO-lkp@intel.com/
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>

show more ...


# f5ae3d9f 10-Sep-2026 Christian Brauner <brauner@kernel.org>

Merge patch series "vfs: Annotate struct fdtable's fd field with __counted_by_ptr"

Annotate struct fdtable's fd field with __counter_by_ptr and add Kunit
tests for struct fdtable.

* patches from ht

Merge patch series "vfs: Annotate struct fdtable's fd field with __counted_by_ptr"

Annotate struct fdtable's fd field with __counter_by_ptr and add Kunit
tests for struct fdtable.

* patches from https://patch.msgid.link/20260827041732.188707-1-morbo@google.com:
vfs: Add KUnit tests for fdtable
vfs: Annotate struct fdtable's fd field with __counted_by_ptr

Link: https://patch.msgid.link/20260827041732.188707-1-morbo@google.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>

show more ...


Revision tags: v7.3-rc2, v7.3-rc1
# 501cbbd2 27-Aug-2026 Bill Wendling <morbo@google.com>

vfs: Add KUnit tests for fdtable

This adds a KUnit test suite for fdtable to verify correct allocation,
max_fds initialization, and dynamic object size of the fd array under
__counted_by_ptr when CO

vfs: Add KUnit tests for fdtable

This adds a KUnit test suite for fdtable to verify correct allocation,
max_fds initialization, and dynamic object size of the fd array under
__counted_by_ptr when CONFIG_CC_HAS_COUNTED_BY_PTR is enabled.

Signed-off-by: Bill Wendling <morbo@google.com>
Link: https://patch.msgid.link/20260827041732.188707-2-morbo@google.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>

show more ...