Re: [PATCH V4 1/9] null_blk: use DEFINE_MUTEX for the file-scope mutex
From: Nilay Shroff
Date: Fri Jul 10 2026 - 08:41:01 EST
On 7/9/26 3:34 PM, Zizhi Wo wrote:
In null_init(), mutex_init(&lock) currently happens after
configfs_register_subsystem(), which exposes the nullb subsystem to
userspace. A racing mkdir() into/sys/kernel/config/nullb/ can reach
null_find_dev_by_name() -> mutex_lock(&lock) before the mutex is
initialized, trigger warning:
Looks good to me.
Reviewed-by: Nilay Shroff <nilay@xxxxxxxxxxxxx>