Hi Richard!
Finally it seems it works after removing ACQUIRE_LOCK_FOR_CURRENT_SCOPE in guestfs_mount_local_run and throwing away all directory cache code.
Although
I didn't try to mix fuse libguestfs client with other clients, I think
guestfs_mount_local_run shouldn't take that specific lock as the
function won't exit until umount and will sit in the loop. I think it
does nothing libguestfs-related, only fuse loop activation.
What I don't understand is how that lock in guestfs_mount_local_run didn't make problems with single threaded fuse_loop.
I'll try to run it a bit more to see if any problems are seen.
If
everything is OK (hope not a false success as directory lists are
slower and race condition maybe less likely), then it should be worth to
see why directory cache made problems, maybe guard it with the same
lock or different one?
What do you think, Richard?
Many thanks for your prompt help,
Maxim.