On 1/16/24 9:13 PM, Chaitanya Kulkarni wrote: > On 1/15/24 19:39, Shin'ichiro Kawasaki wrote: >> Allow setting shared_tags through configfs, which could only be set as a >> module parameter. For that purpose, delay tag_set initialization from >> null_init() to null_add_dev(). Introduce the flag tag_set_initialized to >> manage the initialization status of tag_set. >> >> The following parameters can not be set through configfs yet: >> >> timeout >> requeue >> init_hctx >> >> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> >> --- >> This patch will allow running the blktests test cases block/010 and block/022 >> using the built-in null_blk driver. Corresponding blktests side changes are >> drafted here [1]. >> >> [1] https://github.com/kawasaki/blktests/tree/shared_tags >> >> drivers/block/null_blk/main.c | 38 ++++++++++++++++--------------- >> drivers/block/null_blk/null_blk.h | 1 + >> 2 files changed, 21 insertions(+), 18 deletions(-) >> >> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c >> index 36755f263e8e..c3361e521564 100644 >> --- a/drivers/block/null_blk/main.c >> +++ b/drivers/block/null_blk/main.c >> @@ -69,6 +69,7 @@ static LIST_HEAD(nullb_list); >> static struct mutex lock; >> static int null_major; >> static DEFINE_IDA(nullb_indexes); >> +static bool tag_set_initialized = false; > > explicit initializing global bool to false really needed ? > unless I did something see [1]. > > -ck > > nvme (nvme-6.8) # insmod drivers/block/null_blk/null_blk.ko > nvme (nvme-6.8) # dmesg -c > [23228.355423] null_blk: null_init 2285 abcd 0 abcd_init 0 > [23228.357571] null_blk: disk nullb0 created > [23228.357574] null_blk: module loaded Just as a heads-up, a single test is not proof of anything. That said, static variables are cleared, so they never need to be setup to false. -- Jens Axboe