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

Konstantin Khorenko khorenko at virtuozzo.com
Thu Aug 30 11:26:49 MSK 2018


ploop_req_state_process() requires all ploop requests to have
preq_ub field properly initialized, but i forgot 1 place -
ploop_queue_zero_request():

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.

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

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

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

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)
-- 
2.15.1



More information about the Devel mailing list