Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933177AbbBBL25 (ORCPT ); Mon, 2 Feb 2015 06:28:57 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:26677 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932167AbbBBL2y (ORCPT ); Mon, 2 Feb 2015 06:28:54 -0500 X-IronPort-AV: E=Sophos;i="5.09,505,1418083200"; d="scan'208";a="223488290" From: Roger Pau Monne To: CC: Roger Pau Monne , Konrad Rzeszutek Wilk , Boris Ostrovsky , David Vrabel , Subject: [PATCH] xen-blkfront: fix accounting of reqs when migrating Date: Mon, 2 Feb 2015 11:28:21 +0000 Message-ID: <1422876501-844-1-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 1.9.3 (Apple Git-50) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1720 Lines: 45 Current migration code uses blk_put_request in order to finish a request before requeuing it. This function doesn't update the statistics of the queue, which completely screws accounting. Use blk_end_request_all instead which properly updates the statistics of the queue. Signed-off-by: Roger Pau Monné Reported-and-Tested-by: Ouyang Zhaowei (Charles) Cc: Konrad Rzeszutek Wilk Cc: Boris Ostrovsky Cc: David Vrabel Cc: xen-devel@lists.xenproject.org --- drivers/block/xen-blkfront.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 5ac312f..aac41c1 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1493,7 +1493,7 @@ static int blkif_recover(struct blkfront_info *info) merge_bio.tail = copy[i].request->biotail; bio_list_merge(&bio_list, &merge_bio); copy[i].request->bio = NULL; - blk_put_request(copy[i].request); + blk_end_request_all(copy[i].request, 0); } kfree(copy); @@ -1516,7 +1516,7 @@ static int blkif_recover(struct blkfront_info *info) req->bio = NULL; if (req->cmd_flags & (REQ_FLUSH | REQ_FUA)) pr_alert("diskcache flush request found!\n"); - __blk_put_request(info->rq, req); + __blk_end_request_all(req, 0); } spin_unlock_irq(&info->io_lock); -- 1.9.3 (Apple Git-50) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/