ext4: set s_user_ns in the KUnit tests' fake superblocks
xattr_test_init() builds a fake super_block but never sets s_user_ns.
ext4_xattr_inode_create() calls i_uid_read() and i_gid_read() on the
parent inode, which map the ids through inode->i_sb->s_user_ns. With
CONFIG_USER_NS=y this dereferences a NULL user namespace and triggers
an oops. Fix this by pointing s_user_ns at init_user_ns.
Do the same for the dir, hash, inline and namei tests so they don't
fail if new test cases try to read an inode owner.
Fixes: 5df08dcafa99 ("ext4: add KUnit tests for fs/ext4/xattr.c")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 files changed