* [PATCH] dm bufio: fix missed destroy of mutex c->lock
@ 2018-01-04 14:08 Xiongwei Song
2018-01-04 14:11 ` Xiongwei Song
2018-01-04 17:46 ` Mike Snitzer
0 siblings, 2 replies; 5+ messages in thread
From: Xiongwei Song @ 2018-01-04 14:08 UTC (permalink / raw)
To: agk, snitzer, dm-devel; +Cc: inux-kernel
The mutex c->lock is initialized in dm_bufio_client_create, however,
it is not destroyed before free the structure of dm_bufio_client in
dm_bufio_client_destroy.
Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
---
drivers/md/dm-bufio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index c546b567f3b5..53c0d5d2039a 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1811,6 +1811,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c)
BUG_ON(c->n_buffers[i]);
dm_io_client_destroy(c->dm_io);
+ mutex_destroy(&c->lock);
kfree(c);
}
EXPORT_SYMBOL_GPL(dm_bufio_client_destroy);
--
2.15.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] dm bufio: fix missed destroy of mutex c->lock
2018-01-04 14:08 [PATCH] dm bufio: fix missed destroy of mutex c->lock Xiongwei Song
@ 2018-01-04 14:11 ` Xiongwei Song
2018-01-04 17:46 ` Mike Snitzer
1 sibling, 0 replies; 5+ messages in thread
From: Xiongwei Song @ 2018-01-04 14:11 UTC (permalink / raw)
To: agk, snitzer, dm-devel; +Cc: inux-kernel
2018-01-04 22:08 GMT+08:00 Xiongwei Song <sxwjean@gmail.com>:
> The mutex c->lock is initialized in dm_bufio_client_create, however,
> it is not destroyed before free the structure of dm_bufio_client in
> dm_bufio_client_destroy.
>
> Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
> ---
> drivers/md/dm-bufio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> index c546b567f3b5..53c0d5d2039a 100644
> --- a/drivers/md/dm-bufio.c
> +++ b/drivers/md/dm-bufio.c
> @@ -1811,6 +1811,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c)
> BUG_ON(c->n_buffers[i]);
>
> dm_io_client_destroy(c->dm_io);
> + mutex_destroy(&c->lock);
> kfree(c);
> }
> EXPORT_SYMBOL_GPL(dm_bufio_client_destroy);
> --
> 2.15.1
>
Sorry for the noise. I added incorrect email address.
Please ignore the message. Sorry for this again.
Yours sincerely,
Xiongwei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: dm bufio: fix missed destroy of mutex c->lock
2018-01-04 14:08 [PATCH] dm bufio: fix missed destroy of mutex c->lock Xiongwei Song
2018-01-04 14:11 ` Xiongwei Song
@ 2018-01-04 17:46 ` Mike Snitzer
2018-01-04 22:50 ` Xiongwei Song
1 sibling, 1 reply; 5+ messages in thread
From: Mike Snitzer @ 2018-01-04 17:46 UTC (permalink / raw)
To: Xiongwei Song; +Cc: dm-devel, agk
I already staged a similar fix, see:
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.16&id=cfb0bd8b25eb90faa7cbbad9a52ad2c33102123e
On Thu, Jan 04 2018 at 9:08am -0500,
Xiongwei Song <sxwjean@gmail.com> wrote:
> The mutex c->lock is initialized in dm_bufio_client_create, however,
> it is not destroyed before free the structure of dm_bufio_client in
> dm_bufio_client_destroy.
>
> Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
> ---
> drivers/md/dm-bufio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> index c546b567f3b5..53c0d5d2039a 100644
> --- a/drivers/md/dm-bufio.c
> +++ b/drivers/md/dm-bufio.c
> @@ -1811,6 +1811,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c)
> BUG_ON(c->n_buffers[i]);
>
> dm_io_client_destroy(c->dm_io);
> + mutex_destroy(&c->lock);
> kfree(c);
> }
> EXPORT_SYMBOL_GPL(dm_bufio_client_destroy);
> --
> 2.15.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: dm bufio: fix missed destroy of mutex c->lock
2018-01-04 17:46 ` Mike Snitzer
@ 2018-01-04 22:50 ` Xiongwei Song
0 siblings, 0 replies; 5+ messages in thread
From: Xiongwei Song @ 2018-01-04 22:50 UTC (permalink / raw)
To: Mike Snitzer; +Cc: dm-devel, agk
2018-01-05 1:46 GMT+08:00 Mike Snitzer <snitzer@redhat.com>:
> I already staged a similar fix, see:
> https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.16&id=cfb0bd8b25eb90faa7cbbad9a52ad2c33102123e
Apologies for the noise.
Yours sincerely,
Xiongwei
> On Thu, Jan 04 2018 at 9:08am -0500,
> Xiongwei Song <sxwjean@gmail.com> wrote:
>
>> The mutex c->lock is initialized in dm_bufio_client_create, however,
>> it is not destroyed before free the structure of dm_bufio_client in
>> dm_bufio_client_destroy.
>>
>> Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
>> ---
>> drivers/md/dm-bufio.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
>> index c546b567f3b5..53c0d5d2039a 100644
>> --- a/drivers/md/dm-bufio.c
>> +++ b/drivers/md/dm-bufio.c
>> @@ -1811,6 +1811,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c)
>> BUG_ON(c->n_buffers[i]);
>>
>> dm_io_client_destroy(c->dm_io);
>> + mutex_destroy(&c->lock);
>> kfree(c);
>> }
>> EXPORT_SYMBOL_GPL(dm_bufio_client_destroy);
>> --
>> 2.15.1
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] dm bufio: fix missed destroy of mutex c->lock
@ 2018-01-04 14:31 Xiongwei Song
0 siblings, 0 replies; 5+ messages in thread
From: Xiongwei Song @ 2018-01-04 14:31 UTC (permalink / raw)
To: agk, snitzer, dm-devel; +Cc: linux-kernel
The mutex c->lock is initialized in dm_bufio_client_create, however,
it is not destroyed before free the structure of dm_bufio_client in
dm_bufio_client_destroy.
Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
---
drivers/md/dm-bufio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index c546b567f3b5..53c0d5d2039a 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1811,6 +1811,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c)
BUG_ON(c->n_buffers[i]);
dm_io_client_destroy(c->dm_io);
+ mutex_destroy(&c->lock);
kfree(c);
}
EXPORT_SYMBOL_GPL(dm_bufio_client_destroy);
--
2.15.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-04 22:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-04 14:08 [PATCH] dm bufio: fix missed destroy of mutex c->lock Xiongwei Song
2018-01-04 14:11 ` Xiongwei Song
2018-01-04 17:46 ` Mike Snitzer
2018-01-04 22:50 ` Xiongwei Song
2018-01-04 14:31 [PATCH] " Xiongwei Song
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.