Skip to content
Commit f4f3529c authored by Jeff Cody's avatar Jeff Cody Committed by Michael Roth
Browse files

block/nfs: fix mutex assertion in nfs_file_close()



Commit c096358e 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.

Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
Reviewed-by: default avatarPeter Lieven <pl@kamp.de>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
(cherry picked from commit 113fe792)
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent 5f7f7e4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment