qemu/hw/9pfs
Greg Kurz 7cde47d4a8 9p: add locking to V9fsDir
If several threads concurrently call readdir() with the same directory
stream pointer, it is possible that they all get a pointer to the same
dirent structure, whose content is overwritten each time readdir() is
called.

We must thus serialize accesses to the dirent structure.

This may be achieved with a mutex like below:

lock_mutex();

readdir();

// work with the dirent

unlock_mutex();

This patch adds all the locking, to prepare the switch to readdir().

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
2016-06-06 11:52:34 +02:00
..
9p-handle.c 9p: introduce the V9fsDir type 2016-06-06 11:52:34 +02:00
9p-local.c 9p: introduce the V9fsDir type 2016-06-06 11:52:34 +02:00
9p-posix-acl.c 9pfs: Clean up includes 2016-01-29 15:07:23 +00:00
9p-proxy.c 9p: introduce the V9fsDir type 2016-06-06 11:52:34 +02:00
9p-proxy.h fsdev: rename virtio-9p-marshal.{c,h} to 9p-iov-marshal.{c,h} 2016-01-08 14:35:06 +05:30
9p-synth.c 9p: some more cleanup in #include directives 2016-06-06 11:52:34 +02:00
9p-synth.h all: Clean up includes 2016-02-23 12:43:05 +00:00
9p-xattr-user.c 9pfs: Clean up includes 2016-01-29 15:07:23 +00:00
9p-xattr.c 9pfs: Clean up includes 2016-01-29 15:07:23 +00:00
9p-xattr.h 9pfs: rename virtio-9p-xattr{,-user}.{c,h} to 9p-xattr{,-user}.{c,h} 2016-01-08 12:47:35 +05:30
9p.c 9p: add locking to V9fsDir 2016-06-06 11:52:34 +02:00
9p.h 9p: add locking to V9fsDir 2016-06-06 11:52:34 +02:00
codir.c 9p/fsdev: remove obsolete references to virtio 2016-06-06 11:52:34 +02:00
cofile.c 9p/fsdev: remove obsolete references to virtio 2016-06-06 11:52:34 +02:00
cofs.c 9p/fsdev: remove obsolete references to virtio 2016-06-06 11:52:34 +02:00
coth.c 9p/fsdev: remove obsolete references to virtio 2016-06-06 11:52:34 +02:00
coth.h 9p/fsdev: remove obsolete references to virtio 2016-06-06 11:52:34 +02:00
coxattr.c 9p/fsdev: remove obsolete references to virtio 2016-06-06 11:52:34 +02:00
Makefile.objs 9pfs: rename virtio-9p.c to 9p.c 2016-01-08 15:32:13 +05:30
virtio-9p-device.c 9p: drop useless inclusion of hw/i386/pc.h 2016-06-06 11:52:34 +02:00
virtio-9p.h virtio: move allocation to virtqueue_pop/vring_pop 2016-02-06 20:39:07 +02:00