Skip to contentSkip to conversation

null_blk: Fix the problem "mutex_destroy missing"

PATCH Superseded Zhu Yanjun 2 participants 4 messages Apr 25, 2024 Block layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Zhu Yanjun

author
#0 lore raw

PATCH 1/1 null_blk: Fix the problem "mutex_destroy missing"

When a mutex lock is not used any more, the function mutex_destroy should be called to mark the mutex lock uninitialized.

---
 drivers/block/null_blk/main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/block/null_blk/main.c +2 -0
index ed33cf7192d2..eed63f95e89d 100644
@@ -2113,6 +2113,8 @@ static void __exit null_exit(void)
 
 	if (tag_set.ops)
 		blk_mq_free_tag_set(&tag_set);
+
+	mutex_destroy(&lock);
 }
 
 module_init(null_init);
Signature · 1 line
2.20.1
author
#1 lore raw
Quoted 3 lines · Zhu Yanjun

When a mutex lock is not used any more, the function mutex_destroy should be called to mark the mutex lock uninitialized.

Sorry. Fixes tag is missing.
I will send out the V2 with this Fixes tag.

Zhu Yanjun

Quoted 18 lines
---
  drivers/block/null_blk/main.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/block/null_blk/main.c +2 -0
index ed33cf7192d2..eed63f95e89d 100644
@@ -2113,6 +2113,8 @@ static void __exit null_exit(void)
 
  	if (tag_set.ops)
  		blk_mq_free_tag_set(&tag_set);
+
+	mutex_destroy(&lock);
  }
 
  module_init(null_init);
maintainer
#2 lore raw
Quoted 7 lines · Zhu Yanjun

? 2024/4/25 17:38, Zhu Yanjun ??:

Quoted 3 lines

When a mutex lock is not used any more, the function mutex_destroy should be called to mark the mutex lock uninitialized.

Sorry. Fixes tag is missing.
I will send out the V2 with this Fixes tag.

Then please also fix the commit title, it's pretty bad. Make it something ala:

null_blk: fix missing mutex_destroy() at module removal

Signature · 1 line
Jens Axboe
author
#3 lore raw
Quoted 9 lines · Jens Axboe
Quoted 6 lines · Zhu Yanjun

? 2024/4/25 17:38, Zhu Yanjun ??:

Quoted 3 lines

When a mutex lock is not used any more, the function mutex_destroy should be called to mark the mutex lock uninitialized.

Sorry. Fixes tag is missing.
I will send out the V2 with this Fixes tag.

Then please also fix the commit title, it's pretty bad. Make it something ala:

Got it.

Zhu Yanjun

Quoted 2 lines

null_blk: fix missing mutex_destroy() at module removal

Signature · 1 line
I only represent myself.