On 01.11.2022 10:25, Andrey Zhadchenko wrote:
+/* It is forbidden to call more than one vhost_blk_flush() simultaneously */

Let's add at least a warning for this case:

+static void vhost_blk_flush(struct vhost_blk *blk)
+{
+       int flush_bin;
+
+       spin_lock(&blk->flush_lock);

WARN_ON(blk->during_flush);

+       blk->during_flush = 1;

Because in the case of two flushes, first flush can hang infinitely waiting for its flush_bin to get empty.

--
Best regards, Tikhomirov Pavel
Software Developer, Virtuozzo.
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to