Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1664759

Re: linux-next: manual merge of the block tree with the s390 tree

From Sebastian Ott <sebott@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: linux-next: manual merge of the block tree with the s390 tree
Date 2017-06-13 13:30 +0200
Message-ID <tRSbf-7kq-3@gated-at.bofh.it> (permalink)
References <tRKno-2yk-19@gated-at.bofh.it> <tRNuW-4sb-21@gated-at.bofh.it>
Organization "IBM Deutschland Research & Development GmbH / Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294"

Show all headers | View raw


Hi,

On Tue, 13 Jun 2017, Christoph Hellwig wrote:
> Btw, scm_blk.c blk-mq conversion seems odd if not broken.  It should
> always call blk_mq_complete_request from scm_request_finish and
> then pass the error to blk_mq_end_request frin
> there.

OK. I had added that because rq->errors went away. Would the change below
be ok?

diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index 71c0158..86a8d80 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -249,13 +249,13 @@ static void scm_request_requeue(struct scm_request *scmrq)
 static void scm_request_finish(struct scm_request *scmrq)
 {
 	struct scm_blk_dev *bdev = scmrq->bdev;
+	int *error;
 	int i;
 
 	for (i = 0; i < nr_requests_per_io && scmrq->request[i]; i++) {
-		if (scmrq->error)
-			blk_mq_end_request(scmrq->request[i], scmrq->error);
-		else
-			blk_mq_complete_request(scmrq->request[i]);
+		error = blk_mq_rq_to_pdu(scmrq->request[i]);
+		*error = scmrq->error;
+		blk_mq_complete_request(scmrq->request[i]);
 	}
 
 	atomic_dec(&bdev->queued_reqs);
@@ -415,7 +415,9 @@ void scm_blk_irq(struct scm_device *scmdev, void *data, int error)
 
 static void scm_blk_request_done(struct request *req)
 {
-	blk_mq_end_request(req, 0);
+	int *error = blk_mq_rq_to_pdu(req);
+
+	blk_mq_end_request(req, *error);
 }
 
 static const struct block_device_operations scm_blk_devops = {
@@ -448,6 +450,7 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)
 	atomic_set(&bdev->queued_reqs, 0);
 
 	bdev->tag_set.ops = &scm_mq_ops;
+	bdev->tag_set.cmd_size = sizeof(int);
 	bdev->tag_set.nr_hw_queues = nr_requests;
 	bdev->tag_set.queue_depth = nr_requests_per_io * nr_requests;
 	bdev->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

linux-next: manual merge of the block tree with the s390 tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-06-13 05:10 +0200
  Re: linux-next: manual merge of the block tree with the s390 tree Christoph Hellwig <hch@lst.de> - 2017-06-13 08:30 +0200
    Re: linux-next: manual merge of the block tree with the s390 tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-06-13 08:30 +0200
    Re: linux-next: manual merge of the block tree with the s390 tree Sebastian Ott <sebott@linux.vnet.ibm.com> - 2017-06-13 13:30 +0200

csiph-web