[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH for-2.10] block/nfs: fix mutex assertion in nfs_
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH for-2.10] block/nfs: fix mutex assertion in nfs_file_close() |
Date: |
Tue, 8 Aug 2017 10:53:39 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Mon, Aug 07, 2017 at 06:29:09PM -0400, Jeff Cody wrote:
> Commit c096358e747e88fc7364e40e3c354ee0bb683960 introduced assertion
> checks for when qemu_mutex() functions are called without the
> corresponding qemu_mutex_init() having initialized the mutex.
>
> This uncovered a latent bug in qemu's nfs driver - in
> nfs_client_close(), the NFSClient structure is overwritten with zeros,
> prior to the mutex being destroyed.
>
> Go ahead and destroy the mutex in nfs_client_close(), and change where
> we call qemu_mutex_init() so that it is correctly balanced.
>
> There are also a couple of memory leaks obscured by the memset, so this
> fixes those as well.
>
> Finally, we should be able to get rid of the memset(), as it isn't
> necessary.
>
> Signed-off-by: Jeff Cody <address@hidden>
> ---
> block/nfs.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature