qemu-irix/block
Jeff Cody f4f3529cfe block/nfs: fix mutex assertion in nfs_file_close()
Commit c096358e74 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: Jeff Cody <jcody@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 113fe792fd)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2017-08-24 18:41:21 -05:00
..
Makefile.objs block: Drop unmaintained 'archipelago' driver 2017-03-13 12:49:33 +01:00
accounting.c block: Clean up includes 2016-01-20 13:36:23 +01:00
backup.c backup: React to bdrv_is_allocated() errors 2017-03-13 12:49:33 +01:00
blkdebug.c blkdebug: Catch bs->exact_filename overflow 2017-08-24 16:57:00 -05:00
blkreplay.c block: Do not unref bs->file on error in BD's open 2017-07-31 16:44:54 -05:00
blkverify.c blkverify: Catch bs->exact_filename overflow 2017-08-24 16:57:05 -05:00
block-backend.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
bochs.c block: Request child permissions in format drivers 2017-02-28 20:40:36 +01:00
cloop.c block: Request child permissions in format drivers 2017-02-28 20:40:36 +01:00
commit.c block: Skip implicit nodes in query-block/blockstats 2017-08-24 18:21:56 -05:00
crypto.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
curl.c curl: avoid recursive locking of BDRVCURLState mutex 2017-08-03 14:32:58 -05:00
dirty-bitmap.c dirty-bitmap: Report BlockDirtyInfo.count in bytes, as documented 2017-07-31 15:33:09 -05:00
dmg-bz2.c dmg: Move libbz2 code to dmg-bz2.so 2016-10-07 14:14:06 +02:00
dmg.c block: Request child permissions in format drivers 2017-02-28 20:40:36 +01:00
dmg.h dmg: Move libbz2 code to dmg-bz2.so 2016-10-07 14:14:06 +02:00
file-posix.c qobject: Use simpler QDict/QList scalar insertion macros 2017-07-31 17:11:11 -05:00
file-win32.c qobject: Use simpler QDict/QList scalar insertion macros 2017-07-31 17:11:11 -05:00
gluster.c qapi-schema: SocketAddressFlat variants 'vsock' and 'fd' 2017-04-03 17:11:39 +02:00
io.c block: Guarantee that *file is set on bdrv_get_block_status() 2017-08-03 16:01:28 -05:00
iscsi-opts.c block/iscsi: statically link qemu_iscsi_opts 2017-01-27 18:07:58 +01:00
iscsi.c iscsi: Fix iscsi_create 2017-04-11 15:33:00 +02:00
linux-aio.c block: explicitly acquire aiocontext in aio callbacks that need it 2017-02-21 11:39:39 +00:00
mirror.c block: Skip implicit nodes in query-block/blockstats 2017-08-24 18:21:56 -05:00
nbd-client.c nbd: fix NBD over TLS 2017-08-24 16:57:32 -05:00
nbd-client.h nbd: drop unused NBDClientSession.is_unix field 2017-03-27 14:41:01 +02:00
nbd.c block: Do not strcmp() with NULL uri->scheme 2017-08-24 16:58:11 -05:00
nfs.c block/nfs: fix mutex assertion in nfs_file_close() 2017-08-24 18:41:21 -05:00
null.c qobject: Use simpler QDict/QList scalar insertion macros 2017-07-31 17:11:11 -05:00
parallels.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
qapi.c block: Skip implicit nodes in query-block/blockstats 2017-08-24 18:21:56 -05:00
qcow.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
qcow2-cache.c qcow2: Remove stale comment 2016-11-25 13:51:30 +01:00
qcow2-cluster.c qcow2: Discard unaligned tail when wiping image 2017-04-03 17:11:40 +02:00
qcow2-refcount.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
qcow2-snapshot.c block: Convert bdrv_pwrite(v/_sync) to BdrvChild 2016-07-05 16:46:27 +02:00
qcow2.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
qcow2.h qcow2: Optimize the refcount-block overlap check 2017-02-12 00:47:43 +01:00
qed-check.c qed: Use DIV_ROUND_UP 2016-06-07 18:19:24 +03:00
qed-cluster.c block: explicitly acquire aiocontext in aio callbacks that need it 2017-02-21 11:39:39 +00:00
qed-gencb.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qed-l2-cache.c block: Clean up includes 2016-01-20 13:36:23 +01:00
qed-table.c block: explicitly acquire aiocontext in aio callbacks that need it 2017-02-21 11:39:39 +00:00
qed.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
qed.h block: explicitly acquire aiocontext in timers that need it 2017-02-21 11:14:08 +00:00
quorum.c qobject: Use simpler QDict/QList scalar insertion macros 2017-07-31 17:11:11 -05:00
raw-format.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
rbd.c qobject: Use simpler QDict/QList scalar insertion macros 2017-07-31 17:11:11 -05:00
replication.c replication: clarify permissions 2017-03-17 12:54:06 +01:00
sheepdog.c block: Do not strcmp() with NULL uri->scheme 2017-08-24 16:58:11 -05:00
snapshot.c qobject: Use simpler QDict/QList scalar insertion macros 2017-07-31 17:11:11 -05:00
ssh.c block: Do not strcmp() with NULL uri->scheme 2017-08-24 16:58:11 -05:00
stream.c stream: fix crash in stream_start() when block_job_create() fails 2017-08-03 14:33:26 -05:00
throttle-groups.c coroutine-lock: add mutex argument to CoQueue APIs 2017-02-21 11:39:40 +00:00
trace-events trace: clean up trace-events files 2017-01-31 17:12:15 +00:00
vdi.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
vhdx-endian.c vhdx: Use QEMU UUID API 2016-09-23 11:42:52 +08:00
vhdx-log.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
vhdx.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
vhdx.h
vmdk.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
vpc.c block: Add errp to b{lk,drv}_truncate() 2017-08-03 14:29:55 -05:00
vvfat.c vvfat: fix qemu-img map and qemu-img convert 2017-08-03 14:35:15 -05:00
win32-aio.c block: explicitly acquire aiocontext in aio callbacks that need it 2017-02-21 11:39:39 +00:00
write-threshold.c block: use bdrv_add_before_write_notifier 2016-10-07 13:34:07 +02:00