From patchwork Tue Apr 18 15:52:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9685695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 13A09602C9 for ; Tue, 18 Apr 2017 15:53:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 045652832D for ; Tue, 18 Apr 2017 15:53:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB92C2839C; Tue, 18 Apr 2017 15:53:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A721A2832D for ; Tue, 18 Apr 2017 15:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932377AbdDRPxP (ORCPT ); Tue, 18 Apr 2017 11:53:15 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:38951 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757455AbdDRPwt (ORCPT ); Tue, 18 Apr 2017 11:52:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=j9cOKrEZLnYpMdNvLgnQUkCCjLBBE01zcviYaWU+b9k=; b=Iaw6uYrnuxgLGYX42/j9qdBtH J6rVoYay0uow90WhC3M8PMoaDfE/yVoZO7bHPsZwnPsRb2yqWOjNQc7NRK/9a4tqtYJdoNQihBrjj itGdcsyGaE+43TSDp0PW8JKn3H2SSxG7Hni8jmo35P5d9+UAz95X0FPJ1RXJ4xyTC9fyrONpbqIQb 2yZC3xNHLboFMQKnPWGupSv6ir34gfwMmTvhC9gt1W+3RJts18LfPHHhh2I9wvRy3pLrFVFUgDkPz Y6/SjV0iHLOQTk5FUjs765zHa9hCzVgPqbNS7iZvzb8ibmyXK6458buSZDoGevEPzhud5w0g2thq7 XDaresl3w==; Received: from hch by bombadil.infradead.org with local (Exim 4.87 #1 (Red Hat Linux)) id 1d0VQe-0001ZY-Rj; Tue, 18 Apr 2017 15:52:32 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Josef Bacik , James Smart , Konrad Rzeszutek Wilk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, Christoph Hellwig Subject: virtio_blk: don't use req->errors Date: Tue, 18 Apr 2017 08:52:12 -0700 Message-Id: <20170418155229.5977-7-hch@bombadil.infradead.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170418155229.5977-1-hch@bombadil.infradead.org> References: <20170418155229.5977-1-hch@bombadil.infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christoph Hellwig Remove passing req->errors (which at that point is always 0) to blk_mq_complete_request, and rely on the virtio status code for the serial number passthrough request. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/block/virtio_blk.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index dbc4e80680b1..8378ad480f77 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -175,19 +175,15 @@ static int virtblk_add_req(struct virtqueue *vq, struct virtblk_req *vbr, static inline void virtblk_request_done(struct request *req) { struct virtblk_req *vbr = blk_mq_rq_to_pdu(req); - int error = virtblk_result(vbr); switch (req_op(req)) { case REQ_OP_SCSI_IN: case REQ_OP_SCSI_OUT: virtblk_scsi_request_done(req); break; - case REQ_OP_DRV_IN: - req->errors = (error != 0); - break; } - blk_mq_end_request(req, error); + blk_mq_end_request(req, virtblk_result(vbr)); } static void virtblk_done(struct virtqueue *vq) @@ -205,7 +201,7 @@ static void virtblk_done(struct virtqueue *vq) while ((vbr = virtqueue_get_buf(vblk->vqs[qid].vq, &len)) != NULL) { struct request *req = blk_mq_rq_from_pdu(vbr); - blk_mq_complete_request(req, req->errors); + blk_mq_complete_request(req, 0); req_done = true; } if (unlikely(virtqueue_is_broken(vq))) @@ -311,7 +307,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str) goto out; blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); - err = req->errors ? -EIO : 0; + err = virtblk_result(blk_mq_rq_to_pdu(req)); out: blk_put_request(req); return err;