[Devel,rh7] ploop: push_backup: avoid deadlock on PLOOP_PEEK

Submitted by Maxim Patlasov on Oct. 25, 2016, 11:29 p.m.

Details

Message ID 147743818299.6541.11750007512460293980.stgit@maxim-thinkpad
State New
Series "ploop: push_backup: avoid deadlock on PLOOP_PEEK"
Headers show

Commit Message

Maxim Patlasov Oct. 25, 2016, 11:29 p.m.
ioctl handlers for PLOOP_IOC_PUSH_BACKUP_IO, including
ctl.direction = PLOOP_PEEK must not use ploop_quiesce/relax
because ploop_quiesce waits for completion of active requests,
but some of them may be currently blocked on the progress of
vz_backup_client. Deadlock.

Calling ploop_pb_peek() without protection of ploop_quiesce
is safe because it acquires pbd->ppb_lock anyway. The result
of the ioctl must be consistent because incoming bio-s rely
on the state push_backup maps, but they never change them.

Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
---
 drivers/block/ploop/dev.c |    2 --
 1 file changed, 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 921ec8b..a8720db 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -4822,9 +4822,7 @@  static int ploop_push_backup_io_peek(struct ploop_device *plo,
 {
 	int rc;
 
-	ploop_quiesce(plo);
 	rc = ploop_push_backup_io_get(plo, arg, ctl, ploop_pb_peek);
-	ploop_relax(plo);
 
 	if (rc == -ENOENT) {
 		ctl->n_extents = 0;