[RHEL7,COMMIT] ploop: initialize preq_ub for zero ploop requests as well

Submitted by Konstantin Khorenko on Aug. 30, 2018, 9:05 a.m.


Message ID 201808300905.w7U95rpE001470@finist_ce7.work
State New
Series "ploop: initialize preq_ub for zero ploop requests as well"
Headers show

Commit Message

Konstantin Khorenko Aug. 30, 2018, 9:05 a.m.
The commit is pushed to "branch-rh7-3.10.0-862.11.6.vz7.71.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.11.6.vz7.71.5
commit 0834e058151d0f882b85c9e0521f091bba77195e
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Thu Aug 30 11:11:34 2018 +0300

    ploop: initialize preq_ub for zero ploop requests as well
    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)