linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] null_blk: Fix the problem "mutex_destroy missing"
@ 2024-04-25 15:38 Zhu Yanjun
  2024-04-25 16:16 ` Zhu Yanjun
  0 siblings, 1 reply; 4+ messages in thread
From: Zhu Yanjun @ 2024-04-25 15:38 UTC (permalink / raw)
  To: axboe, dlemoal, linux-block; +Cc: Zhu Yanjun

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

Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
 drivers/block/null_blk/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index ed33cf7192d2..eed63f95e89d 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] null_blk: Fix the problem "mutex_destroy missing"
  2024-04-25 15:38 [PATCH 1/1] null_blk: Fix the problem "mutex_destroy missing" Zhu Yanjun
@ 2024-04-25 16:16 ` Zhu Yanjun
  2024-04-25 16:22   ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Zhu Yanjun @ 2024-04-25 16:16 UTC (permalink / raw)
  To: axboe, dlemoal, linux-block

在 2024/4/25 17:38, 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

> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> ---
>   drivers/block/null_blk/main.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
> index ed33cf7192d2..eed63f95e89d 100644
> --- a/drivers/block/null_blk/main.c
> +++ b/drivers/block/null_blk/main.c
> @@ -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);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] null_blk: Fix the problem "mutex_destroy missing"
  2024-04-25 16:16 ` Zhu Yanjun
@ 2024-04-25 16:22   ` Jens Axboe
  2024-04-25 16:39     ` Zhu Yanjun
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2024-04-25 16:22 UTC (permalink / raw)
  To: Zhu Yanjun, dlemoal, linux-block

On 4/25/24 10:16 AM, Zhu Yanjun wrote:
> ? 2024/4/25 17:38, 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.

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

null_blk: fix missing mutex_destroy() at module removal

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] null_blk: Fix the problem "mutex_destroy missing"
  2024-04-25 16:22   ` Jens Axboe
@ 2024-04-25 16:39     ` Zhu Yanjun
  0 siblings, 0 replies; 4+ messages in thread
From: Zhu Yanjun @ 2024-04-25 16:39 UTC (permalink / raw)
  To: Jens Axboe, dlemoal, linux-block


在 2024/4/25 18:22, Jens Axboe 写道:
> On 4/25/24 10:16 AM, Zhu Yanjun wrote:
>> ? 2024/4/25 17:38, 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.
> Then please also fix the commit title, it's pretty bad. Make it
> something ala:

Got it.

Zhu Yanjun

> null_blk: fix missing mutex_destroy() at module removal
>
-- 
I only represent myself.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-25 16:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-25 15:38 [PATCH 1/1] null_blk: Fix the problem "mutex_destroy missing" Zhu Yanjun
2024-04-25 16:16 ` Zhu Yanjun
2024-04-25 16:22   ` Jens Axboe
2024-04-25 16:39     ` Zhu Yanjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).