[vz7] ploop: initialize preq_ub for zero ploop requests as well

Submitted by Konstantin Khorenko on Aug. 30, 2018, 8:26 a.m.


Message ID 20180830082649.979-1-khorenko@virtuozzo.com
State New
Series "ploop: initialize preq_ub for zero ploop requests as well"
Headers show

Commit Message

Konstantin Khorenko Aug. 30, 2018, 8:26 a.m.
ploop_req_state_process() requires all ploop requests to have
preq_ub field properly initialized, but i forgot 1 place -

it does not alloc new ploop request, but gets one from
fbd->free_zero_list, so need to init exec_ub there as well.

Q: Why we can trust current->exec_ub in ploop_queue_zero_request()?
A: Because ploop_queue_zero_request() is called from
   ploop_req_state_process() that or another way and
   ploop_req_state_process() sets proper exec_ub at the beginning.

Check for put_beancounter() correctness for zero ploop request:
ploop request is retuned back to "free_zero_list" in
ploop_complete_request()->ploop_fb_put_zero_request() only and
ploop_complete_request() puts preq_ub beancounter properly.


Fixes: ae4abe579715 ("ploop: store exec_ub in ploop request and use it
while processing requests")

Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
 drivers/block/ploop/dev.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index a71f28476eca..aeb2ad1cf0cf 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -1691,6 +1691,7 @@  void ploop_queue_zero_request(struct ploop_device *plo,
 	preq->error = 0;
 	preq->tstamp = jiffies;
 	preq->iblock = 0;
+	preq->preq_ub = get_beancounter(get_exec_ub());
 	if (test_bit(PLOOP_REQ_RELOC_S, &orig_preq->state)) {
 		if (orig_preq->dst_iblock == ~0U)