Re: [Qemu-devel] [PATCH 3/4] 9p: add locking to V9fsDir

2016-06-02 Thread Eric Blake
On 06/02/2016 02:52 AM, Greg Kurz wrote: > If several threads call concurrently readdir() with the same directory s/call concurrently/concurrently call/ > stream pointer, it is possible that they all get a pointer to the same > dirent structure, whose content is overwritten each time readdir() is

[Qemu-devel] [PATCH 3/4] 9p: add locking to V9fsDir

2016-06-02 Thread Greg Kurz
If several threads call concurrently 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