[Devel] [PATCH rh7 1/2] ploop: push_backup: roll back ALLOW_READS patch

Maxim Patlasov mpatlasov at virtuozzo.com
Thu Jun 2 16:52:37 PDT 2016


The patch reverts:

Subject: [PATCH rh7] ploop: push_backup must pass READs intact

If push_backup is in progress (doesn't matter "full" or "incremental") and
ploop state-machine detects incoming WRITE request to the cluster-block that
was not push_backup-ed yet, it suspends the request until userspace reports it
as "processed".

The above is fine, but while such a WRITE request is suspended, only
subsequent WRITEs (to given cluster-block) must be suspended too. READs must
not. Otherwise userspace backup tool will be blocked infinintely trying
to push_backup given cluster-block.

Passing READs while blocking WRITEs must be OK because: 1) ploop has not
finalized that first WRITE yet; 2) given cluster-block will be kept
intact (non-modified) while the WRITE is suspended.

https://jira.sw.ru/browse/PSBM-46775

Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 drivers/block/ploop/dev.c   |    7 -------
 include/linux/ploop/ploop.h |    1 -
 2 files changed, 8 deletions(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 96f7850..d3f0ec0 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -1137,11 +1137,6 @@ static int check_lockout(struct ploop_request *preq)
 		else if (preq->req_cluster > p->req_cluster)
 			n = n->rb_right;
 		else {
-			/* do not block backup tool READs from /dev/ploop */
-			if (!(preq->req_rw & REQ_WRITE) &&
-			    test_bit(PLOOP_REQ_ALLOW_READS, &p->state))
-				return 0;
-
 			list_add_tail(&preq->list, &p->delay_list);
 			plo->st.bio_lockouts++;
 			trace_preq_lockout(preq, p);
@@ -2053,7 +2048,6 @@ restart:
 			ploop_pb_clear_bit(plo->pbd, preq->req_cluster);
 		} else {
 			spin_lock_irq(&plo->lock);
-			__set_bit(PLOOP_REQ_ALLOW_READS, &preq->state);
 			ploop_add_lockout(preq, 0);
 			spin_unlock_irq(&plo->lock);
 			/*
@@ -2072,7 +2066,6 @@ restart:
 
 		spin_lock_irq(&plo->lock);
 		del_lockout(preq);
-		__clear_bit(PLOOP_REQ_ALLOW_READS, &preq->state);
 		if (!list_empty(&preq->delay_list))
 			list_splice_init(&preq->delay_list, plo->ready_queue.prev);
 		spin_unlock_irq(&plo->lock);
diff --git a/include/linux/ploop/ploop.h b/include/linux/ploop/ploop.h
index 0fba25e..77fd833 100644
--- a/include/linux/ploop/ploop.h
+++ b/include/linux/ploop/ploop.h
@@ -470,7 +470,6 @@ enum
 	PLOOP_REQ_KAIO_FSYNC,	/*force image fsync by KAIO module */
 	PLOOP_REQ_POST_SUBMIT, /* preq needs post_submit processing */
 	PLOOP_REQ_PUSH_BACKUP, /* preq was ACKed by userspace push_backup */
-	PLOOP_REQ_ALLOW_READS, /* READs are allowed for given req_cluster */
 	PLOOP_REQ_FSYNC_DONE,  /* fsync_thread() performed f_op->fsync() */
 };
 



More information about the Devel mailing list