Skip to content

Commit 5941a07

Browse files
Ye Bintytso
authored andcommitted
ext4: fix miss unlock 'sb->s_umount' in extents_kunit_init()
There's warning as follows when do ext4 kunit test: WARNING: kunit_try_catch/15923 still has locks held! 7.0.0-rc3-next-20260309-00028-g73f965a1bbb1-dirty #281 Tainted: G E N 1 lock held by kunit_try_catch/15923: #0: ffff888139f860e0 (&type->s_umount_key#70/1){+.+.}-{4:4}, at: alloc_super.constprop.0+0x172/0xa90 Call Trace: <TASK> dump_stack_lvl+0x180/0x1b0 debug_check_no_locks_held+0xc8/0xd0 do_exit+0x1502/0x2b20 kthread+0x3a9/0x540 ret_from_fork+0xa76/0xdf0 ret_from_fork_asm+0x1a/0x30 As sget() will return 'sb' which holds 's->s_umount' lock. However, "extents-test" miss unlock this lock. So unlock 's->s_umount' in the end of extents_kunit_init(). Fixes: cb1e0c1 ("ext4: kunit tests for extent splitting and conversion") Signed-off-by: Ye Bin <yebin10@huawei.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Link: https://patch.msgid.link/20260330133035.287842-2-yebin@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent eceafc3 commit 5941a07

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/ext4/extents-test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ static int extents_kunit_init(struct kunit *test)
309309
kunit_activate_static_stub(test, ext4_ext_zeroout, ext4_ext_zeroout_stub);
310310
kunit_activate_static_stub(test, ext4_issue_zeroout,
311311
ext4_issue_zeroout_stub);
312+
up_write(&sb->s_umount);
313+
312314
return 0;
313315
}
314316

0 commit comments

Comments
 (0)