All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] Twelve small block layer patches
@ 2017-08-17 23:22 Bart Van Assche
  2017-08-17 23:23 ` [PATCH 01/12] block: Fix two comments that refer to .queue_rq() return values Bart Van Assche
                   ` (13 more replies)
  0 siblings, 14 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:22 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Christoph Hellwig, Bart Van Assche

Hello Jens,

The twelve patches in this series are patches I came up with while working
on block drivers and SCSI drivers. Please consider these for inclusion in
kernel v4.14.

Thanks,

Bart.

Bart Van Assche (12):
  block: Fix two comments that refer to .queue_rq() return values
  block: Unexport blk_queue_end_tag()
  blk-mq: Explain when 'active_queues' is decremented
  blk-mq: Make blk_mq_reinit_tagset() calls easier to read
  blk-mq-debugfs: Declare a local symbol static
  blk-mq-debugfs: Generate name-to-text translation tables
  genhd: Annotate all part and part_tbl pointer dereferences
  ide-floppy: Use blk_rq_is_scsi()
  virtio_blk: Use blk_rq_is_scsi()
  xen-blkback: Fix indentation
  xen-blkback: Avoid that gcc 7 warns about fall-through when building
    with W=1
  xen-blkfront: Avoid that gcc 7 warns about fall-through when building
    with W=1

 block/.gitignore                    |   1 +
 block/Makefile                      |  58 ++++++++++++++++
 block/blk-mq-debugfs.c              | 132 +-----------------------------------
 block/blk-mq-tag.c                  |   9 +--
 block/blk-mq.c                      |   8 ++-
 block/blk-tag.c                     |   1 -
 block/genhd.c                       |  15 ++--
 block/partition-generic.c           |  15 +++-
 drivers/block/virtio_blk.c          |   2 +-
 drivers/block/xen-blkback/blkback.c |   5 +-
 drivers/block/xen-blkback/xenbus.c  |   3 +-
 drivers/block/xen-blkfront.c        |   2 +-
 drivers/ide/ide-floppy.c            |   2 +-
 drivers/nvme/host/fc.c              |   4 +-
 drivers/nvme/host/rdma.c            |  11 +--
 include/linux/blk-mq.h              |   5 +-
 16 files changed, 112 insertions(+), 161 deletions(-)
 create mode 100644 block/.gitignore

-- 
2.14.0

^ permalink raw reply	[flat|nested] 45+ messages in thread

* [PATCH 01/12] block: Fix two comments that refer to .queue_rq() return values
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  7:31   ` Hannes Reinecke
  2017-08-17 23:23 ` [PATCH 02/12] block: Unexport blk_queue_end_tag() Bart Van Assche
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Ming Lei,
	Hannes Reinecke, Johannes Thumshirn

Since patch "blk-mq: switch .queue_rq return value to blk_status_t"
.queue_rq() returns a BLK_STS_* value instead of a BLK_MQ_RQ_*
value. Hence refer to the former in comments about .queue_rq()
return values.

Fixes: commit 39a70c76b89b ("blk-mq: clarify dispatch may not be drained/blocked by stopping queue")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
 block/blk-mq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index fe764ca16993..f84d145490bf 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1258,7 +1258,7 @@ EXPORT_SYMBOL(blk_mq_queue_stopped);
 /*
  * This function is often used for pausing .queue_rq() by driver when
  * there isn't enough resource or some conditions aren't satisfied, and
- * BLK_MQ_RQ_QUEUE_BUSY is usually returned.
+ * BLK_STS_RESOURCE is usually returned.
  *
  * We do not guarantee that dispatch can be drained or blocked
  * after blk_mq_stop_hw_queue() returns. Please use
@@ -1275,7 +1275,7 @@ EXPORT_SYMBOL(blk_mq_stop_hw_queue);
 /*
  * This function is often used for pausing .queue_rq() by driver when
  * there isn't enough resource or some conditions aren't satisfied, and
- * BLK_MQ_RQ_QUEUE_BUSY is usually returned.
+ * BLK_STS_RESOURCE is usually returned.
  *
  * We do not guarantee that dispatch can be drained or blocked
  * after blk_mq_stop_hw_queues() returns. Please use
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 02/12] block: Unexport blk_queue_end_tag()
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
  2017-08-17 23:23 ` [PATCH 01/12] block: Fix two comments that refer to .queue_rq() return values Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  7:31   ` Hannes Reinecke
  2017-08-17 23:23 ` [PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented Bart Van Assche
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Hannes Reinecke,
	Johannes Thumshirn

This function is only used inside the block layer core. Hence
unexport it.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
 block/blk-tag.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/blk-tag.c b/block/blk-tag.c
index 2290f65b9d73..e1a9c15eb1b8 100644
--- a/block/blk-tag.c
+++ b/block/blk-tag.c
@@ -290,7 +290,6 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)
 	 */
 	clear_bit_unlock(tag, bqt->tag_map);
 }
-EXPORT_SYMBOL(blk_queue_end_tag);
 
 /**
  * blk_queue_start_tag - find a free tag and assign it
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
  2017-08-17 23:23 ` [PATCH 01/12] block: Fix two comments that refer to .queue_rq() return values Bart Van Assche
  2017-08-17 23:23 ` [PATCH 02/12] block: Unexport blk_queue_end_tag() Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  7:32   ` Hannes Reinecke
  2017-08-18 14:34   ` Jens Axboe
  2017-08-17 23:23 ` [PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read Bart Van Assche
                   ` (10 subsequent siblings)
  13 siblings, 2 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Hannes Reinecke,
	Johannes Thumshirn

It is nontrivial to derive from the blk-mq source code when
blk_mq_tags.active_queues is decremented. Hence add a comment that
explains this.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
 block/blk-mq.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index f84d145490bf..b86d2cafc355 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -834,6 +834,10 @@ static void blk_mq_timeout_work(struct work_struct *work)
 	} else {
 		struct blk_mq_hw_ctx *hctx;
 
+		/*
+		 * All requests finished (latest request timeout) seconds ago,
+		 * so mark each hctx as idle.
+		 */
 		queue_for_each_hw_ctx(q, hctx, i) {
 			/* the hctx may be unmapped, so check it here */
 			if (blk_mq_hw_queue_mapped(hctx))
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
                   ` (2 preceding siblings ...)
  2017-08-17 23:23 ` [PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  7:32   ` Hannes Reinecke
  2017-08-20  6:15   ` Sagi Grimberg
  2017-08-17 23:23 ` [PATCH 05/12] blk-mq-debugfs: Declare a local symbol static Bart Van Assche
                   ` (9 subsequent siblings)
  13 siblings, 2 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Bart Van Assche,
	Sagi Grimberg, James Smart, Johannes Thumshirn

Since blk_mq_ops.reinit_request is only called from inside
blk_mq_reinit_tagset(), make this function pointer an argument of
blk_mq_reinit_tagset() instead of a member of struct blk_mq_ops.
This patch does not change any functionality but makes
blk_mq_reinit_tagset() calls easier to read and to analyze.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: James Smart <james.smart@broadcom.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
 block/blk-mq-tag.c       |  9 +++++----
 drivers/nvme/host/fc.c   |  4 +---
 drivers/nvme/host/rdma.c | 11 ++++++-----
 include/linux/blk-mq.h   |  5 ++---
 4 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index dc9e6dac5a2a..6714507aa6c7 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -298,11 +298,12 @@ void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
 }
 EXPORT_SYMBOL(blk_mq_tagset_busy_iter);
 
-int blk_mq_reinit_tagset(struct blk_mq_tag_set *set)
+int blk_mq_reinit_tagset(struct blk_mq_tag_set *set,
+			 int (reinit_request)(void *, struct request *))
 {
 	int i, j, ret = 0;
 
-	if (!set->ops->reinit_request)
+	if (WARN_ON_ONCE(!reinit_request))
 		goto out;
 
 	for (i = 0; i < set->nr_hw_queues; i++) {
@@ -315,8 +316,8 @@ int blk_mq_reinit_tagset(struct blk_mq_tag_set *set)
 			if (!tags->static_rqs[j])
 				continue;
 
-			ret = set->ops->reinit_request(set->driver_data,
-						tags->static_rqs[j]);
+			ret = reinit_request(set->driver_data,
+					     tags->static_rqs[j]);
 			if (ret)
 				goto out;
 		}
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 5c2a08ef08ba..1438be649866 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2168,7 +2168,6 @@ static const struct blk_mq_ops nvme_fc_mq_ops = {
 	.complete	= nvme_fc_complete_rq,
 	.init_request	= nvme_fc_init_request,
 	.exit_request	= nvme_fc_exit_request,
-	.reinit_request	= nvme_fc_reinit_request,
 	.init_hctx	= nvme_fc_init_hctx,
 	.poll		= nvme_fc_poll,
 	.timeout	= nvme_fc_timeout,
@@ -2269,7 +2268,7 @@ nvme_fc_reinit_io_queues(struct nvme_fc_ctrl *ctrl)
 
 	nvme_fc_init_io_queues(ctrl);
 
-	ret = blk_mq_reinit_tagset(&ctrl->tag_set);
+	ret = blk_mq_reinit_tagset(&ctrl->tag_set, nvme_fc_reinit_request);
 	if (ret)
 		goto out_free_io_queues;
 
@@ -2655,7 +2654,6 @@ static const struct blk_mq_ops nvme_fc_admin_mq_ops = {
 	.complete	= nvme_fc_complete_rq,
 	.init_request	= nvme_fc_init_request,
 	.exit_request	= nvme_fc_exit_request,
-	.reinit_request	= nvme_fc_reinit_request,
 	.init_hctx	= nvme_fc_init_admin_hctx,
 	.timeout	= nvme_fc_timeout,
 };
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index da04df1af231..9ff0eb3a625e 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -704,14 +704,16 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work)
 	if (ctrl->ctrl.queue_count > 1) {
 		nvme_rdma_free_io_queues(ctrl);
 
-		ret = blk_mq_reinit_tagset(&ctrl->tag_set);
+		ret = blk_mq_reinit_tagset(&ctrl->tag_set,
+					   nvme_rdma_reinit_request);
 		if (ret)
 			goto requeue;
 	}
 
 	nvme_rdma_stop_and_free_queue(&ctrl->queues[0]);
 
-	ret = blk_mq_reinit_tagset(&ctrl->admin_tag_set);
+	ret = blk_mq_reinit_tagset(&ctrl->admin_tag_set,
+				   nvme_rdma_reinit_request);
 	if (ret)
 		goto requeue;
 
@@ -1503,7 +1505,6 @@ static const struct blk_mq_ops nvme_rdma_mq_ops = {
 	.complete	= nvme_rdma_complete_rq,
 	.init_request	= nvme_rdma_init_request,
 	.exit_request	= nvme_rdma_exit_request,
-	.reinit_request	= nvme_rdma_reinit_request,
 	.init_hctx	= nvme_rdma_init_hctx,
 	.poll		= nvme_rdma_poll,
 	.timeout	= nvme_rdma_timeout,
@@ -1514,7 +1515,6 @@ static const struct blk_mq_ops nvme_rdma_admin_mq_ops = {
 	.complete	= nvme_rdma_complete_rq,
 	.init_request	= nvme_rdma_init_request,
 	.exit_request	= nvme_rdma_exit_request,
-	.reinit_request	= nvme_rdma_reinit_request,
 	.init_hctx	= nvme_rdma_init_admin_hctx,
 	.timeout	= nvme_rdma_timeout,
 };
@@ -1712,7 +1712,8 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
 	}
 
 	if (ctrl->ctrl.queue_count > 1) {
-		ret = blk_mq_reinit_tagset(&ctrl->tag_set);
+		ret = blk_mq_reinit_tagset(&ctrl->tag_set,
+					   nvme_rdma_reinit_request);
 		if (ret)
 			goto del_dead_ctrl;
 
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 14542308d25b..50c6485cb04f 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -97,7 +97,6 @@ typedef int (init_request_fn)(struct blk_mq_tag_set *set, struct request *,
 		unsigned int, unsigned int);
 typedef void (exit_request_fn)(struct blk_mq_tag_set *set, struct request *,
 		unsigned int);
-typedef int (reinit_request_fn)(void *, struct request *);
 
 typedef void (busy_iter_fn)(struct blk_mq_hw_ctx *, struct request *, void *,
 		bool);
@@ -143,7 +142,6 @@ struct blk_mq_ops {
 	 */
 	init_request_fn		*init_request;
 	exit_request_fn		*exit_request;
-	reinit_request_fn	*reinit_request;
 	/* Called from inside blk_get_request() */
 	void (*initialize_rq_fn)(struct request *rq);
 
@@ -261,7 +259,8 @@ void blk_freeze_queue_start(struct request_queue *q);
 void blk_mq_freeze_queue_wait(struct request_queue *q);
 int blk_mq_freeze_queue_wait_timeout(struct request_queue *q,
 				     unsigned long timeout);
-int blk_mq_reinit_tagset(struct blk_mq_tag_set *set);
+int blk_mq_reinit_tagset(struct blk_mq_tag_set *set,
+			 int (reinit_request)(void *, struct request *));
 
 int blk_mq_map_queues(struct blk_mq_tag_set *set);
 void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues);
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 05/12] blk-mq-debugfs: Declare a local symbol static
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
                   ` (3 preceding siblings ...)
  2017-08-17 23:23 ` [PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  6:52   ` Omar Sandoval
  2017-08-18  7:33   ` Hannes Reinecke
  2017-08-17 23:23 ` [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables Bart Van Assche
                   ` (8 subsequent siblings)
  13 siblings, 2 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Bart Van Assche,
	Omar Sandoval

This was detected by sparse.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Omar Sandoval <osandov@fb.com>
---
 block/blk-mq-debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 55940ddacd96..e53b6129ca5a 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -739,7 +739,7 @@ static int blk_mq_debugfs_release(struct inode *inode, struct file *file)
 		return seq_release(inode, file);
 }
 
-const struct file_operations blk_mq_debugfs_fops = {
+static const struct file_operations blk_mq_debugfs_fops = {
 	.open		= blk_mq_debugfs_open,
 	.read		= seq_read,
 	.write		= blk_mq_debugfs_write,
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
                   ` (4 preceding siblings ...)
  2017-08-17 23:23 ` [PATCH 05/12] blk-mq-debugfs: Declare a local symbol static Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  7:38   ` Hannes Reinecke
  2017-08-18 14:35   ` Jens Axboe
  2017-08-17 23:23 ` [PATCH 07/12] genhd: Annotate all part and part_tbl pointer dereferences Bart Van Assche
                   ` (7 subsequent siblings)
  13 siblings, 2 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Omar Sandoval,
	Hannes Reinecke

It is easy to add a flag to one of the block layer headers and to
forget to update blk-mq-debugfs.c. E.g. QUEUE_FLAG_SCSI_PASSTHROUGH,
QUEUE_FLAG_QUIESCED and REQ_NOWAIT are missing from blk-mq-debugfs.c.
Hence generate the symbol-to-text translation tables.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Hannes Reinecke <hare@suse.com>
---
 block/.gitignore       |   1 +
 block/Makefile         |  58 ++++++++++++++++++++++
 block/blk-mq-debugfs.c | 130 +------------------------------------------------
 3 files changed, 61 insertions(+), 128 deletions(-)
 create mode 100644 block/.gitignore

diff --git a/block/.gitignore b/block/.gitignore
new file mode 100644
index 000000000000..63b09639ab06
--- /dev/null
+++ b/block/.gitignore
@@ -0,0 +1 @@
+blk-name-tables.c
diff --git a/block/Makefile b/block/Makefile
index 2b281cf258a0..f9bd77426ac1 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -33,3 +33,61 @@ obj-$(CONFIG_BLK_DEV_ZONED)	+= blk-zoned.o
 obj-$(CONFIG_BLK_WBT)		+= blk-wbt.o
 obj-$(CONFIG_BLK_DEBUG_FS)	+= blk-mq-debugfs.o
 obj-$(CONFIG_BLK_SED_OPAL)	+= sed-opal.o
+
+clean-files := blk-name-tables.c
+
+$(obj)/blk-mq-debugfs.o: $(obj)/blk-name-tables.c
+
+$(obj)/blk-name-tables.c: block/Makefile block/blk.h include/linux/blk-mq.h \
+		include/linux/blk_types.h include/linux/blkdev.h
+	@(								\
+	printf "static const char *const blk_queue_flag_name[] = {\n";	\
+	s='^#define QUEUE_FLAG_\([^[:blank:]]*\)[[:blank:]]\+[0-9]\+.*';\
+	r='\t\[QUEUE_FLAG_\1\] = "\1",';				\
+	sed -n "s/$$s/$$r/p" include/linux/blkdev.h;			\
+	printf "};\n";							\
+	printf "\n";							\
+	printf "static const char *const hctx_state_name[] = {\n";	\
+	s='^[[:blank:]]BLK_MQ_S_\([^[:blank:]]*\)[[:blank:]]\+=[[:blank:]]*[0-9]\+.*'; \
+	r='\t\[BLK_MQ_S_\1\] = "\1",';					\
+	sed -n "s/$$s/$$r/p" include/linux/blk-mq.h;			\
+	printf "};\n";							\
+	printf "\n";							\
+	printf "static const char *const alloc_policy_name[] = {\n";	\
+	s='^#define BLK_TAG_ALLOC_\([^[:blank:]]*\)[[:blank:]]\+[0-9]\+.*';\
+	r='\t\[BLK_TAG_ALLOC_\1\] = "\1",';				\
+	sed -n "s/$$s/$$r/p" include/linux/blkdev.h;			\
+	printf "};\n";							\
+	printf "\n";							\
+	printf "static const char *const hctx_flag_name[] = {\n";	\
+	s='^[[:blank:]]BLK_MQ_F_\([^[:blank:]]*\)[[:blank:]]\+=[[:blank:]]*[0-9]\+.*'; \
+	r='\t\[ilog2(BLK_MQ_F_\1)\] = "\1",';				\
+	sed -n "s/$$s/$$r/p" include/linux/blk-mq.h |			\
+	grep -v BLK_MQ_F_ALLOC_POLICY_;					\
+	printf "};\n";							\
+	printf "\n";							\
+	printf "static const char *const op_name[] = {\n";		\
+	s='^[[:blank:]]REQ_OP_\([^[:blank:]]*\)[[:blank:]]\+=[[:blank:]]*[0-9]\+.*';   \
+	r='\t\[REQ_OP_\1\] = "\1",';					\
+	sed -n "s/$$s/$$r/p" include/linux/blk_types.h;			\
+	printf "};\n";							\
+	printf "\n";							\
+	printf "static const char *const cmd_flag_name[] = {\n";	\
+	s='^#define REQ_\([^[:blank:]]*\)[[:blank:]]*(1.*';		\
+	r='\t\[REQ_\1\] = "\1",';					\
+	sed -n "s/$$s/$$r/p" include/linux/blk_types.h;			\
+	printf "};\n";							\
+	printf "\n";							\
+	printf "static const char *const rqf_name[] = {\n";		\
+	s='^#define RQF_\([^[:blank:]]*\)[[:blank:]]\+(.*';		\
+	r='\t\[RQF_\1\] = "\1",';					\
+	sed -n "s/$$s/$$r/p" include/linux/blkdev.h;			\
+	printf "};\n";							\
+	printf "\n";							\
+	printf "static const char *const rqaf_name[] = {\n";		\
+	s='^[[:blank:]]REQ_ATOM_\([^[:blank:],]*\).*';			\
+	r='\t\[REQ_ATOM_\1\] = "\1",';					\
+	sed -n "s/$$s/$$r/p" block/blk.h;				\
+	printf "};\n";							\
+	printf "\n";							\
+	) >$@
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index e53b6129ca5a..a3239db953b7 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -24,6 +24,8 @@
 #include "blk-mq-debugfs.h"
 #include "blk-mq-tag.h"
 
+#include "blk-name-tables.c"
+
 static int blk_flags_show(struct seq_file *m, const unsigned long flags,
 			  const char *const *flag_name, int flag_name_count)
 {
@@ -44,38 +46,6 @@ static int blk_flags_show(struct seq_file *m, const unsigned long flags,
 	return 0;
 }
 
-#define QUEUE_FLAG_NAME(name) [QUEUE_FLAG_##name] = #name
-static const char *const blk_queue_flag_name[] = {
-	QUEUE_FLAG_NAME(QUEUED),
-	QUEUE_FLAG_NAME(STOPPED),
-	QUEUE_FLAG_NAME(DYING),
-	QUEUE_FLAG_NAME(BYPASS),
-	QUEUE_FLAG_NAME(BIDI),
-	QUEUE_FLAG_NAME(NOMERGES),
-	QUEUE_FLAG_NAME(SAME_COMP),
-	QUEUE_FLAG_NAME(FAIL_IO),
-	QUEUE_FLAG_NAME(STACKABLE),
-	QUEUE_FLAG_NAME(NONROT),
-	QUEUE_FLAG_NAME(IO_STAT),
-	QUEUE_FLAG_NAME(DISCARD),
-	QUEUE_FLAG_NAME(NOXMERGES),
-	QUEUE_FLAG_NAME(ADD_RANDOM),
-	QUEUE_FLAG_NAME(SECERASE),
-	QUEUE_FLAG_NAME(SAME_FORCE),
-	QUEUE_FLAG_NAME(DEAD),
-	QUEUE_FLAG_NAME(INIT_DONE),
-	QUEUE_FLAG_NAME(NO_SG_MERGE),
-	QUEUE_FLAG_NAME(POLL),
-	QUEUE_FLAG_NAME(WC),
-	QUEUE_FLAG_NAME(FUA),
-	QUEUE_FLAG_NAME(FLUSH_NQ),
-	QUEUE_FLAG_NAME(DAX),
-	QUEUE_FLAG_NAME(STATS),
-	QUEUE_FLAG_NAME(POLL_STATS),
-	QUEUE_FLAG_NAME(REGISTERED),
-};
-#undef QUEUE_FLAG_NAME
-
 static int queue_state_show(void *data, struct seq_file *m)
 {
 	struct request_queue *q = data;
@@ -173,16 +143,6 @@ static int queue_poll_stat_show(void *data, struct seq_file *m)
 	return 0;
 }
 
-#define HCTX_STATE_NAME(name) [BLK_MQ_S_##name] = #name
-static const char *const hctx_state_name[] = {
-	HCTX_STATE_NAME(STOPPED),
-	HCTX_STATE_NAME(TAG_ACTIVE),
-	HCTX_STATE_NAME(SCHED_RESTART),
-	HCTX_STATE_NAME(TAG_WAITING),
-	HCTX_STATE_NAME(START_ON_RUN),
-};
-#undef HCTX_STATE_NAME
-
 static int hctx_state_show(void *data, struct seq_file *m)
 {
 	struct blk_mq_hw_ctx *hctx = data;
@@ -193,23 +153,6 @@ static int hctx_state_show(void *data, struct seq_file *m)
 	return 0;
 }
 
-#define BLK_TAG_ALLOC_NAME(name) [BLK_TAG_ALLOC_##name] = #name
-static const char *const alloc_policy_name[] = {
-	BLK_TAG_ALLOC_NAME(FIFO),
-	BLK_TAG_ALLOC_NAME(RR),
-};
-#undef BLK_TAG_ALLOC_NAME
-
-#define HCTX_FLAG_NAME(name) [ilog2(BLK_MQ_F_##name)] = #name
-static const char *const hctx_flag_name[] = {
-	HCTX_FLAG_NAME(SHOULD_MERGE),
-	HCTX_FLAG_NAME(TAG_SHARED),
-	HCTX_FLAG_NAME(SG_MERGE),
-	HCTX_FLAG_NAME(BLOCKING),
-	HCTX_FLAG_NAME(NO_SCHED),
-};
-#undef HCTX_FLAG_NAME
-
 static int hctx_flags_show(void *data, struct seq_file *m)
 {
 	struct blk_mq_hw_ctx *hctx = data;
@@ -229,75 +172,6 @@ static int hctx_flags_show(void *data, struct seq_file *m)
 	return 0;
 }
 
-#define REQ_OP_NAME(name) [REQ_OP_##name] = #name
-static const char *const op_name[] = {
-	REQ_OP_NAME(READ),
-	REQ_OP_NAME(WRITE),
-	REQ_OP_NAME(FLUSH),
-	REQ_OP_NAME(DISCARD),
-	REQ_OP_NAME(ZONE_REPORT),
-	REQ_OP_NAME(SECURE_ERASE),
-	REQ_OP_NAME(ZONE_RESET),
-	REQ_OP_NAME(WRITE_SAME),
-	REQ_OP_NAME(WRITE_ZEROES),
-	REQ_OP_NAME(SCSI_IN),
-	REQ_OP_NAME(SCSI_OUT),
-	REQ_OP_NAME(DRV_IN),
-	REQ_OP_NAME(DRV_OUT),
-};
-#undef REQ_OP_NAME
-
-#define CMD_FLAG_NAME(name) [__REQ_##name] = #name
-static const char *const cmd_flag_name[] = {
-	CMD_FLAG_NAME(FAILFAST_DEV),
-	CMD_FLAG_NAME(FAILFAST_TRANSPORT),
-	CMD_FLAG_NAME(FAILFAST_DRIVER),
-	CMD_FLAG_NAME(SYNC),
-	CMD_FLAG_NAME(META),
-	CMD_FLAG_NAME(PRIO),
-	CMD_FLAG_NAME(NOMERGE),
-	CMD_FLAG_NAME(IDLE),
-	CMD_FLAG_NAME(INTEGRITY),
-	CMD_FLAG_NAME(FUA),
-	CMD_FLAG_NAME(PREFLUSH),
-	CMD_FLAG_NAME(RAHEAD),
-	CMD_FLAG_NAME(BACKGROUND),
-	CMD_FLAG_NAME(NOUNMAP),
-};
-#undef CMD_FLAG_NAME
-
-#define RQF_NAME(name) [ilog2((__force u32)RQF_##name)] = #name
-static const char *const rqf_name[] = {
-	RQF_NAME(SORTED),
-	RQF_NAME(STARTED),
-	RQF_NAME(QUEUED),
-	RQF_NAME(SOFTBARRIER),
-	RQF_NAME(FLUSH_SEQ),
-	RQF_NAME(MIXED_MERGE),
-	RQF_NAME(MQ_INFLIGHT),
-	RQF_NAME(DONTPREP),
-	RQF_NAME(PREEMPT),
-	RQF_NAME(COPY_USER),
-	RQF_NAME(FAILED),
-	RQF_NAME(QUIET),
-	RQF_NAME(ELVPRIV),
-	RQF_NAME(IO_STAT),
-	RQF_NAME(ALLOCED),
-	RQF_NAME(PM),
-	RQF_NAME(HASHED),
-	RQF_NAME(STATS),
-	RQF_NAME(SPECIAL_PAYLOAD),
-};
-#undef RQF_NAME
-
-#define RQAF_NAME(name) [REQ_ATOM_##name] = #name
-static const char *const rqaf_name[] = {
-	RQAF_NAME(COMPLETE),
-	RQAF_NAME(STARTED),
-	RQAF_NAME(POLL_SLEPT),
-};
-#undef RQAF_NAME
-
 int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq)
 {
 	const struct blk_mq_ops *const mq_ops = rq->q->mq_ops;
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 07/12] genhd: Annotate all part and part_tbl pointer dereferences
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
                   ` (5 preceding siblings ...)
  2017-08-17 23:23 ` [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  7:39   ` Hannes Reinecke
  2017-08-17 23:23 ` [PATCH 08/12] ide-floppy: Use blk_rq_is_scsi() Bart Van Assche
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Bart Van Assche,
	Tejun Heo, Jan Kara, Dan Williams

Annotate gendisk.part_tbl and disk_part_tbl.part dereferences with
rcu_dereference_protected(). This patch does not change the behavior
of the modified code but ensures that sparse does not complain about
disk->part_tbl manipulations nor about part_tbl->part accesses.
Additionally, improve documentation of the locking requirements of
the modified functions.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
---
 block/genhd.c             | 15 ++++++++++-----
 block/partition-generic.c | 15 ++++++++++++---
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index 3dc4d115480f..2367087cdb7c 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1127,12 +1127,13 @@ static const struct attribute_group *disk_attr_groups[] = {
  * original ptbl is freed using RCU callback.
  *
  * LOCKING:
- * Matching bd_mutx locked.
+ * Matching bd_mutex locked or the caller is the only user of @disk.
  */
 static void disk_replace_part_tbl(struct gendisk *disk,
 				  struct disk_part_tbl *new_ptbl)
 {
-	struct disk_part_tbl *old_ptbl = disk->part_tbl;
+	struct disk_part_tbl *old_ptbl =
+		rcu_dereference_protected(disk->part_tbl, 1);
 
 	rcu_assign_pointer(disk->part_tbl, new_ptbl);
 
@@ -1151,14 +1152,16 @@ static void disk_replace_part_tbl(struct gendisk *disk,
  * uses RCU to allow unlocked dereferencing for stats and other stuff.
  *
  * LOCKING:
- * Matching bd_mutex locked, might sleep.
+ * Matching bd_mutex locked or the caller is the only user of @disk.
+ * Might sleep.
  *
  * RETURNS:
  * 0 on success, -errno on failure.
  */
 int disk_expand_part_tbl(struct gendisk *disk, int partno)
 {
-	struct disk_part_tbl *old_ptbl = disk->part_tbl;
+	struct disk_part_tbl *old_ptbl =
+		rcu_dereference_protected(disk->part_tbl, 1);
 	struct disk_part_tbl *new_ptbl;
 	int len = old_ptbl ? old_ptbl->len : 0;
 	int i, target;
@@ -1352,6 +1355,7 @@ EXPORT_SYMBOL(alloc_disk);
 struct gendisk *alloc_disk_node(int minors, int node_id)
 {
 	struct gendisk *disk;
+	struct disk_part_tbl *ptbl;
 
 	disk = kzalloc_node(sizeof(struct gendisk), GFP_KERNEL, node_id);
 	if (disk) {
@@ -1365,7 +1369,8 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
 			kfree(disk);
 			return NULL;
 		}
-		disk->part_tbl->part[0] = &disk->part0;
+		ptbl = rcu_dereference_protected(disk->part_tbl, 1);
+		rcu_assign_pointer(ptbl->part[0], &disk->part0);
 
 		/*
 		 * set_capacity() and get_capacity() currently don't use
diff --git a/block/partition-generic.c b/block/partition-generic.c
index fa5049a4d99b..1745a9659517 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -252,15 +252,20 @@ void __delete_partition(struct percpu_ref *ref)
 	call_rcu(&part->rcu_head, delete_partition_rcu_cb);
 }
 
+/*
+ * Must be called either with bd_mutex held, before a disk can be opened or
+ * after all disk users are gone.
+ */
 void delete_partition(struct gendisk *disk, int partno)
 {
-	struct disk_part_tbl *ptbl = disk->part_tbl;
+	struct disk_part_tbl *ptbl =
+		rcu_dereference_protected(disk->part_tbl, 1);
 	struct hd_struct *part;
 
 	if (partno >= ptbl->len)
 		return;
 
-	part = ptbl->part[partno];
+	part = rcu_dereference_protected(ptbl->part[partno], 1);
 	if (!part)
 		return;
 
@@ -280,6 +285,10 @@ static ssize_t whole_disk_show(struct device *dev,
 static DEVICE_ATTR(whole_disk, S_IRUSR | S_IRGRP | S_IROTH,
 		   whole_disk_show, NULL);
 
+/*
+ * Must be called either with bd_mutex held, before a disk can be opened or
+ * after all disk users are gone.
+ */
 struct hd_struct *add_partition(struct gendisk *disk, int partno,
 				sector_t start, sector_t len, int flags,
 				struct partition_meta_info *info)
@@ -295,7 +304,7 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
 	err = disk_expand_part_tbl(disk, partno);
 	if (err)
 		return ERR_PTR(err);
-	ptbl = disk->part_tbl;
+	ptbl = rcu_dereference_protected(disk->part_tbl, 1);
 
 	if (ptbl->part[partno])
 		return ERR_PTR(-EBUSY);
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 08/12] ide-floppy: Use blk_rq_is_scsi()
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
                   ` (6 preceding siblings ...)
  2017-08-17 23:23 ` [PATCH 07/12] genhd: Annotate all part and part_tbl pointer dereferences Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  5:00   ` David Miller
  2017-08-18  7:39   ` Hannes Reinecke
  2017-08-17 23:23 ` [PATCH 09/12] virtio_blk: " Bart Van Assche
                   ` (5 subsequent siblings)
  13 siblings, 2 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche,
	David S . Miller, linux-ide

This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: linux-ide@vger.kernel.org
---
 drivers/ide/ide-floppy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 627b1f62a749..3ddd88219906 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -72,7 +72,7 @@ static int ide_floppy_callback(ide_drive_t *drive, int dsc)
 		drive->failed_pc = NULL;
 
 	if (pc->c[0] == GPCMD_READ_10 || pc->c[0] == GPCMD_WRITE_10 ||
-	    (req_op(rq) == REQ_OP_SCSI_IN || req_op(rq) == REQ_OP_SCSI_OUT))
+	    blk_rq_is_scsi(rq))
 		uptodate = 1; /* FIXME */
 	else if (pc->c[0] == GPCMD_REQUEST_SENSE) {
 
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 09/12] virtio_blk: Use blk_rq_is_scsi()
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
                   ` (8 preceding siblings ...)
  2017-08-17 23:23 ` [PATCH 09/12] virtio_blk: " Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  7:39   ` Hannes Reinecke
  2017-08-18  7:39   ` Hannes Reinecke
  2017-08-17 23:23   ` Bart Van Assche
                   ` (3 subsequent siblings)
  13 siblings, 2 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche,
	Michael S . Tsirkin, Jason Wang, virtualization

This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org
---
 drivers/block/virtio_blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 1498b899a593..0ba1eb911a42 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -265,7 +265,7 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
 	}
 
 	spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
-	if (req_op(req) == REQ_OP_SCSI_IN || req_op(req) == REQ_OP_SCSI_OUT)
+	if (blk_rq_is_scsi(req))
 		err = virtblk_add_req_scsi(vblk->vqs[qid].vq, vbr, vbr->sg, num);
 	else
 		err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 09/12] virtio_blk: Use blk_rq_is_scsi()
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
                   ` (7 preceding siblings ...)
  2017-08-17 23:23 ` [PATCH 08/12] ide-floppy: Use blk_rq_is_scsi() Bart Van Assche
@ 2017-08-17 23:23 ` Bart Van Assche
  2017-08-17 23:23 ` Bart Van Assche
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Michael S . Tsirkin, virtualization, linux-block,
	Bart Van Assche, Christoph Hellwig

This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org
---
 drivers/block/virtio_blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 1498b899a593..0ba1eb911a42 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -265,7 +265,7 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
 	}
 
 	spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
-	if (req_op(req) == REQ_OP_SCSI_IN || req_op(req) == REQ_OP_SCSI_OUT)
+	if (blk_rq_is_scsi(req))
 		err = virtblk_add_req_scsi(vblk->vqs[qid].vq, vbr, vbr->sg, num);
 	else
 		err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 10/12] xen-blkback: Fix indentation
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
@ 2017-08-17 23:23   ` Bart Van Assche
  2017-08-17 23:23 ` [PATCH 02/12] block: Unexport blk_queue_end_tag() Bart Van Assche
                     ` (12 subsequent siblings)
  13 siblings, 0 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche,
	Konrad Rzeszutek Wilk, Roger Pau Monn303251, xen-devel

Avoid that smatch reports the following warning when building with
C=2 CHECK="smatch -p=kernel":

drivers/block/xen-blkback/blkback.c:710 xen_blkbk_unmap_prepare() warn: inconsistent indenting

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org
---
 drivers/block/xen-blkback/blkback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index fe7cd58c43d0..68157a84bf4d 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -705,9 +705,9 @@ static unsigned int xen_blkbk_unmap_prepare(
 				    GNTMAP_host_map, pages[i]->handle);
 		pages[i]->handle = BLKBACK_INVALID_HANDLE;
 		invcount++;
-       }
+	}
 
-       return invcount;
+	return invcount;
 }
 
 static void xen_blkbk_unmap_and_respond_callback(int result, struct gntab_unmap_queue_data *data)
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 10/12] xen-blkback: Fix indentation
@ 2017-08-17 23:23   ` Bart Van Assche
  0 siblings, 0 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Bart Van Assche, xen-devel, Christoph Hellwig,
	Roger Pau Monn303251

Avoid that smatch reports the following warning when building with
C=2 CHECK="smatch -p=kernel":

drivers/block/xen-blkback/blkback.c:710 xen_blkbk_unmap_prepare() warn: inconsistent indenting

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org
---
 drivers/block/xen-blkback/blkback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index fe7cd58c43d0..68157a84bf4d 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -705,9 +705,9 @@ static unsigned int xen_blkbk_unmap_prepare(
 				    GNTMAP_host_map, pages[i]->handle);
 		pages[i]->handle = BLKBACK_INVALID_HANDLE;
 		invcount++;
-       }
+	}
 
-       return invcount;
+	return invcount;
 }
 
 static void xen_blkbk_unmap_and_respond_callback(int result, struct gntab_unmap_queue_data *data)
-- 
2.14.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 11/12] xen-blkback: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
@ 2017-08-17 23:23   ` Bart Van Assche
  2017-08-17 23:23 ` [PATCH 02/12] block: Unexport blk_queue_end_tag() Bart Van Assche
                     ` (12 subsequent siblings)
  13 siblings, 0 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche,
	Konrad Rzeszutek Wilk, Roger Pau Monn303251, xen-devel

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org
---
 drivers/block/xen-blkback/blkback.c | 1 +
 drivers/block/xen-blkback/xenbus.c  | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 68157a84bf4d..5f3a813e7ae0 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -1251,6 +1251,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
 		break;
 	case BLKIF_OP_WRITE_BARRIER:
 		drain = true;
+		/* fall through */
 	case BLKIF_OP_FLUSH_DISKCACHE:
 		ring->st_f_req++;
 		operation = REQ_OP_WRITE;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index 792da683e70d..88eaea6475d7 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -810,7 +810,8 @@ static void frontend_changed(struct xenbus_device *dev,
 		xenbus_switch_state(dev, XenbusStateClosed);
 		if (xenbus_dev_is_online(dev))
 			break;
-		/* fall through if not online */
+		/* fall through */
+		/* if not online */
 	case XenbusStateUnknown:
 		/* implies xen_blkif_disconnect() via xen_blkbk_remove() */
 		device_unregister(&dev->dev);
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 11/12] xen-blkback: Avoid that gcc 7 warns about fall-through when building with W=1
@ 2017-08-17 23:23   ` Bart Van Assche
  0 siblings, 0 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Bart Van Assche, xen-devel, Christoph Hellwig,
	Roger Pau Monn303251

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org
---
 drivers/block/xen-blkback/blkback.c | 1 +
 drivers/block/xen-blkback/xenbus.c  | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 68157a84bf4d..5f3a813e7ae0 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -1251,6 +1251,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
 		break;
 	case BLKIF_OP_WRITE_BARRIER:
 		drain = true;
+		/* fall through */
 	case BLKIF_OP_FLUSH_DISKCACHE:
 		ring->st_f_req++;
 		operation = REQ_OP_WRITE;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index 792da683e70d..88eaea6475d7 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -810,7 +810,8 @@ static void frontend_changed(struct xenbus_device *dev,
 		xenbus_switch_state(dev, XenbusStateClosed);
 		if (xenbus_dev_is_online(dev))
 			break;
-		/* fall through if not online */
+		/* fall through */
+		/* if not online */
 	case XenbusStateUnknown:
 		/* implies xen_blkif_disconnect() via xen_blkbk_remove() */
 		device_unregister(&dev->dev);
-- 
2.14.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
@ 2017-08-17 23:23   ` Bart Van Assche
  2017-08-17 23:23 ` [PATCH 02/12] block: Unexport blk_queue_end_tag() Bart Van Assche
                     ` (12 subsequent siblings)
  13 siblings, 0 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche,
	Konrad Rzeszutek Wilk, Roger Pau Monn303251, xen-devel

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org
---
 drivers/block/xen-blkfront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 98e34e4c62b8..270019e3e5d8 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2456,7 +2456,7 @@ static void blkback_changed(struct xenbus_device *dev,
 	case XenbusStateClosed:
 		if (dev->state == XenbusStateClosed)
 			break;
-		/* Missed the backend's Closing state -- fallthrough */
+		/* fall through */
 	case XenbusStateClosing:
 		if (info)
 			blkfront_closing(info);
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* [PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1
@ 2017-08-17 23:23   ` Bart Van Assche
  0 siblings, 0 replies; 45+ messages in thread
From: Bart Van Assche @ 2017-08-17 23:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Bart Van Assche, xen-devel, Christoph Hellwig,
	Roger Pau Monn303251

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org
---
 drivers/block/xen-blkfront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 98e34e4c62b8..270019e3e5d8 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2456,7 +2456,7 @@ static void blkback_changed(struct xenbus_device *dev,
 	case XenbusStateClosed:
 		if (dev->state == XenbusStateClosed)
 			break;
-		/* Missed the backend's Closing state -- fallthrough */
+		/* fall through */
 	case XenbusStateClosing:
 		if (info)
 			blkfront_closing(info);
-- 
2.14.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* Re: [PATCH 08/12] ide-floppy: Use blk_rq_is_scsi()
  2017-08-17 23:23 ` [PATCH 08/12] ide-floppy: Use blk_rq_is_scsi() Bart Van Assche
@ 2017-08-18  5:00   ` David Miller
  2017-08-18  7:39   ` Hannes Reinecke
  1 sibling, 0 replies; 45+ messages in thread
From: David Miller @ 2017-08-18  5:00 UTC (permalink / raw)
  To: bart.vanassche; +Cc: axboe, linux-block, hch, linux-ide

From: Bart Van Assche <bart.vanassche@wdc.com>
Date: Thu, 17 Aug 2017 16:23:07 -0700

> This patch does not change any functionality.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 05/12] blk-mq-debugfs: Declare a local symbol static
  2017-08-17 23:23 ` [PATCH 05/12] blk-mq-debugfs: Declare a local symbol static Bart Van Assche
@ 2017-08-18  6:52   ` Omar Sandoval
  2017-08-18  7:33   ` Hannes Reinecke
  1 sibling, 0 replies; 45+ messages in thread
From: Omar Sandoval @ 2017-08-18  6:52 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Jens Axboe, linux-block, Christoph Hellwig, Bart Van Assche,
	Omar Sandoval

On Thu, Aug 17, 2017 at 04:23:04PM -0700, Bart Van Assche wrote:
> This was detected by sparse.

Reviewed-by: Omar Sandoval <osandov@fb.com>

> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Omar Sandoval <osandov@fb.com>
> ---
>  block/blk-mq-debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index 55940ddacd96..e53b6129ca5a 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -739,7 +739,7 @@ static int blk_mq_debugfs_release(struct inode *inode, struct file *file)
>  		return seq_release(inode, file);
>  }
>  
> -const struct file_operations blk_mq_debugfs_fops = {
> +static const struct file_operations blk_mq_debugfs_fops = {
>  	.open		= blk_mq_debugfs_open,
>  	.read		= seq_read,
>  	.write		= blk_mq_debugfs_write,
> -- 
> 2.14.0
> 

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 01/12] block: Fix two comments that refer to .queue_rq() return values
  2017-08-17 23:23 ` [PATCH 01/12] block: Fix two comments that refer to .queue_rq() return values Bart Van Assche
@ 2017-08-18  7:31   ` Hannes Reinecke
  0 siblings, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:31 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Ming Lei, Johannes Thumshirn

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> Since patch "blk-mq: switch .queue_rq return value to blk_status_t"
> .queue_rq() returns a BLK_STS_* value instead of a BLK_MQ_RQ_*
> value. Hence refer to the former in comments about .queue_rq()
> return values.
> 
> Fixes: commit 39a70c76b89b ("blk-mq: clarify dispatch may not be drained/blocked by stopping queue")
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  block/blk-mq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index fe764ca16993..f84d145490bf 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1258,7 +1258,7 @@ EXPORT_SYMBOL(blk_mq_queue_stopped);
>  /*
>   * This function is often used for pausing .queue_rq() by driver when
>   * there isn't enough resource or some conditions aren't satisfied, and
> - * BLK_MQ_RQ_QUEUE_BUSY is usually returned.
> + * BLK_STS_RESOURCE is usually returned.
>   *
>   * We do not guarantee that dispatch can be drained or blocked
>   * after blk_mq_stop_hw_queue() returns. Please use
> @@ -1275,7 +1275,7 @@ EXPORT_SYMBOL(blk_mq_stop_hw_queue);
>  /*
>   * This function is often used for pausing .queue_rq() by driver when
>   * there isn't enough resource or some conditions aren't satisfied, and
> - * BLK_MQ_RQ_QUEUE_BUSY is usually returned.
> + * BLK_STS_RESOURCE is usually returned.
>   *
>   * We do not guarantee that dispatch can be drained or blocked
>   * after blk_mq_stop_hw_queues() returns. Please use
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 02/12] block: Unexport blk_queue_end_tag()
  2017-08-17 23:23 ` [PATCH 02/12] block: Unexport blk_queue_end_tag() Bart Van Assche
@ 2017-08-18  7:31   ` Hannes Reinecke
  0 siblings, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:31 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Johannes Thumshirn

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> This function is only used inside the block layer core. Hence
> unexport it.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  block/blk-tag.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/block/blk-tag.c b/block/blk-tag.c
> index 2290f65b9d73..e1a9c15eb1b8 100644
> --- a/block/blk-tag.c
> +++ b/block/blk-tag.c
> @@ -290,7 +290,6 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)
>  	 */
>  	clear_bit_unlock(tag, bqt->tag_map);
>  }
> -EXPORT_SYMBOL(blk_queue_end_tag);
>  
>  /**
>   * blk_queue_start_tag - find a free tag and assign it
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented
  2017-08-17 23:23 ` [PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented Bart Van Assche
@ 2017-08-18  7:32   ` Hannes Reinecke
  2017-08-18 14:34   ` Jens Axboe
  1 sibling, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:32 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Johannes Thumshirn

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> It is nontrivial to derive from the blk-mq source code when
> blk_mq_tags.active_queues is decremented. Hence add a comment that
> explains this.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  block/blk-mq.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index f84d145490bf..b86d2cafc355 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -834,6 +834,10 @@ static void blk_mq_timeout_work(struct work_struct *work)
>  	} else {
>  		struct blk_mq_hw_ctx *hctx;
>  
> +		/*
> +		 * All requests finished (latest request timeout) seconds ago,
> +		 * so mark each hctx as idle.
> +		 */
>  		queue_for_each_hw_ctx(q, hctx, i) {
>  			/* the hctx may be unmapped, so check it here */
>  			if (blk_mq_hw_queue_mapped(hctx))
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read
  2017-08-17 23:23 ` [PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read Bart Van Assche
@ 2017-08-18  7:32   ` Hannes Reinecke
  2017-08-20  6:15   ` Sagi Grimberg
  1 sibling, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:32 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Sagi Grimberg,
	James Smart, Johannes Thumshirn

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> Since blk_mq_ops.reinit_request is only called from inside
> blk_mq_reinit_tagset(), make this function pointer an argument of
> blk_mq_reinit_tagset() instead of a member of struct blk_mq_ops.
> This patch does not change any functionality but makes
> blk_mq_reinit_tagset() calls easier to read and to analyze.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Sagi Grimberg <sagi@grimberg.me>
> Cc: James Smart <james.smart@broadcom.com>
> Cc: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  block/blk-mq-tag.c       |  9 +++++----
>  drivers/nvme/host/fc.c   |  4 +---
>  drivers/nvme/host/rdma.c | 11 ++++++-----
>  include/linux/blk-mq.h   |  5 ++---
>  4 files changed, 14 insertions(+), 15 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 05/12] blk-mq-debugfs: Declare a local symbol static
  2017-08-17 23:23 ` [PATCH 05/12] blk-mq-debugfs: Declare a local symbol static Bart Van Assche
  2017-08-18  6:52   ` Omar Sandoval
@ 2017-08-18  7:33   ` Hannes Reinecke
  1 sibling, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:33 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Omar Sandoval

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> This was detected by sparse.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Omar Sandoval <osandov@fb.com>
> ---
>  block/blk-mq-debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index 55940ddacd96..e53b6129ca5a 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -739,7 +739,7 @@ static int blk_mq_debugfs_release(struct inode *inode, struct file *file)
>  		return seq_release(inode, file);
>  }
>  
> -const struct file_operations blk_mq_debugfs_fops = {
> +static const struct file_operations blk_mq_debugfs_fops = {
>  	.open		= blk_mq_debugfs_open,
>  	.read		= seq_read,
>  	.write		= blk_mq_debugfs_write,
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables
  2017-08-17 23:23 ` [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables Bart Van Assche
@ 2017-08-18  7:38   ` Hannes Reinecke
  2017-08-18 14:35   ` Jens Axboe
  1 sibling, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:38 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Omar Sandoval, Hannes Reinecke

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> It is easy to add a flag to one of the block layer headers and to
> forget to update blk-mq-debugfs.c. E.g. QUEUE_FLAG_SCSI_PASSTHROUGH,
> QUEUE_FLAG_QUIESCED and REQ_NOWAIT are missing from blk-mq-debugfs.c.
> Hence generate the symbol-to-text translation tables.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Omar Sandoval <osandov@fb.com>
> Cc: Hannes Reinecke <hare@suse.com>
> ---
>  block/.gitignore       |   1 +
>  block/Makefile         |  58 ++++++++++++++++++++++
>  block/blk-mq-debugfs.c | 130 +------------------------------------------------
>  3 files changed, 61 insertions(+), 128 deletions(-)
>  create mode 100644 block/.gitignore
> 
> diff --git a/block/.gitignore b/block/.gitignore
> new file mode 100644
> index 000000000000..63b09639ab06
> --- /dev/null
> +++ b/block/.gitignore
> @@ -0,0 +1 @@
> +blk-name-tables.c
> diff --git a/block/Makefile b/block/Makefile
> index 2b281cf258a0..f9bd77426ac1 100644
> --- a/block/Makefile
> +++ b/block/Makefile
> @@ -33,3 +33,61 @@ obj-$(CONFIG_BLK_DEV_ZONED)	+= blk-zoned.o
>  obj-$(CONFIG_BLK_WBT)		+= blk-wbt.o
>  obj-$(CONFIG_BLK_DEBUG_FS)	+= blk-mq-debugfs.o
>  obj-$(CONFIG_BLK_SED_OPAL)	+= sed-opal.o
> +
> +clean-files := blk-name-tables.c
> +
> +$(obj)/blk-mq-debugfs.o: $(obj)/blk-name-tables.c
> +
> +$(obj)/blk-name-tables.c: block/Makefile block/blk.h include/linux/blk-mq.h \
> +		include/linux/blk_types.h include/linux/blkdev.h
> +	@(								\
> +	printf "static const char *const blk_queue_flag_name[] = {\n";	\
> +	s='^#define QUEUE_FLAG_\([^[:blank:]]*\)[[:blank:]]\+[0-9]\+.*';\
> +	r='\t\[QUEUE_FLAG_\1\] = "\1",';				\
> +	sed -n "s/$$s/$$r/p" include/linux/blkdev.h;			\
> +	printf "};\n";							\
> +	printf "\n";							\
> +	printf "static const char *const hctx_state_name[] = {\n";	\
> +	s='^[[:blank:]]BLK_MQ_S_\([^[:blank:]]*\)[[:blank:]]\+=[[:blank:]]*[0-9]\+.*'; \
> +	r='\t\[BLK_MQ_S_\1\] = "\1",';					\
> +	sed -n "s/$$s/$$r/p" include/linux/blk-mq.h;			\
> +	printf "};\n";							\
> +	printf "\n";							\
> +	printf "static const char *const alloc_policy_name[] = {\n";	\
> +	s='^#define BLK_TAG_ALLOC_\([^[:blank:]]*\)[[:blank:]]\+[0-9]\+.*';\
> +	r='\t\[BLK_TAG_ALLOC_\1\] = "\1",';				\
> +	sed -n "s/$$s/$$r/p" include/linux/blkdev.h;			\
> +	printf "};\n";							\
> +	printf "\n";							\
> +	printf "static const char *const hctx_flag_name[] = {\n";	\
> +	s='^[[:blank:]]BLK_MQ_F_\([^[:blank:]]*\)[[:blank:]]\+=[[:blank:]]*[0-9]\+.*'; \
> +	r='\t\[ilog2(BLK_MQ_F_\1)\] = "\1",';				\
> +	sed -n "s/$$s/$$r/p" include/linux/blk-mq.h |			\
> +	grep -v BLK_MQ_F_ALLOC_POLICY_;					\
> +	printf "};\n";							\
> +	printf "\n";							\
> +	printf "static const char *const op_name[] = {\n";		\
> +	s='^[[:blank:]]REQ_OP_\([^[:blank:]]*\)[[:blank:]]\+=[[:blank:]]*[0-9]\+.*';   \
> +	r='\t\[REQ_OP_\1\] = "\1",';					\
> +	sed -n "s/$$s/$$r/p" include/linux/blk_types.h;			\
> +	printf "};\n";							\
> +	printf "\n";							\
> +	printf "static const char *const cmd_flag_name[] = {\n";	\
> +	s='^#define REQ_\([^[:blank:]]*\)[[:blank:]]*(1.*';		\
> +	r='\t\[REQ_\1\] = "\1",';					\
> +	sed -n "s/$$s/$$r/p" include/linux/blk_types.h;			\
> +	printf "};\n";							\
> +	printf "\n";							\
> +	printf "static const char *const rqf_name[] = {\n";		\
> +	s='^#define RQF_\([^[:blank:]]*\)[[:blank:]]\+(.*';		\
> +	r='\t\[RQF_\1\] = "\1",';					\
> +	sed -n "s/$$s/$$r/p" include/linux/blkdev.h;			\
> +	printf "};\n";							\
> +	printf "\n";							\
> +	printf "static const char *const rqaf_name[] = {\n";		\
> +	s='^[[:blank:]]REQ_ATOM_\([^[:blank:],]*\).*';			\
> +	r='\t\[REQ_ATOM_\1\] = "\1",';					\
> +	sed -n "s/$$s/$$r/p" block/blk.h;				\
> +	printf "};\n";							\
> +	printf "\n";							\
> +	) >$@

Can't you just make this a generic function, and run this per header file?
In the end, each file might be changed independently, so we really
should have distinct makefile target here and not lump it all into one.
Plus I need this function for my 'blacklist' sysfs attribute, too.

And, not forgetting, we should be doing some sort of error handling
here. It's all nice and proper to have decoded flags, but if things goes
pearshaped we might end up with invalid values in the respective
variable. In those cases we _really_ want to see those values, hence I
would advocate for printing out _all_ values, decoding those we know
about, and print out the remaining ones verbatim.

Thanks.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 07/12] genhd: Annotate all part and part_tbl pointer dereferences
  2017-08-17 23:23 ` [PATCH 07/12] genhd: Annotate all part and part_tbl pointer dereferences Bart Van Assche
@ 2017-08-18  7:39   ` Hannes Reinecke
  0 siblings, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:39 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Tejun Heo,
	Jan Kara, Dan Williams

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> Annotate gendisk.part_tbl and disk_part_tbl.part dereferences with
> rcu_dereference_protected(). This patch does not change the behavior
> of the modified code but ensures that sparse does not complain about
> disk->part_tbl manipulations nor about part_tbl->part accesses.
> Additionally, improve documentation of the locking requirements of
> the modified functions.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Christoph Hellwig <hch@lst.de>
> ---
>  block/genhd.c             | 15 ++++++++++-----
>  block/partition-generic.c | 15 ++++++++++++---
>  2 files changed, 22 insertions(+), 8 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 08/12] ide-floppy: Use blk_rq_is_scsi()
  2017-08-17 23:23 ` [PATCH 08/12] ide-floppy: Use blk_rq_is_scsi() Bart Van Assche
  2017-08-18  5:00   ` David Miller
@ 2017-08-18  7:39   ` Hannes Reinecke
  1 sibling, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:39 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, David S . Miller, linux-ide

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> This patch does not change any functionality.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: linux-ide@vger.kernel.org
> ---
>  drivers/ide/ide-floppy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
> index 627b1f62a749..3ddd88219906 100644
> --- a/drivers/ide/ide-floppy.c
> +++ b/drivers/ide/ide-floppy.c
> @@ -72,7 +72,7 @@ static int ide_floppy_callback(ide_drive_t *drive, int dsc)
>  		drive->failed_pc = NULL;
>  
>  	if (pc->c[0] == GPCMD_READ_10 || pc->c[0] == GPCMD_WRITE_10 ||
> -	    (req_op(rq) == REQ_OP_SCSI_IN || req_op(rq) == REQ_OP_SCSI_OUT))
> +	    blk_rq_is_scsi(rq))
>  		uptodate = 1; /* FIXME */
>  	else if (pc->c[0] == GPCMD_REQUEST_SENSE) {
>  
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 09/12] virtio_blk: Use blk_rq_is_scsi()
  2017-08-17 23:23 ` Bart Van Assche
  2017-08-18  7:39   ` Hannes Reinecke
@ 2017-08-18  7:39   ` Hannes Reinecke
  1 sibling, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:39 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Michael S . Tsirkin, Jason Wang,
	virtualization

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> This patch does not change any functionality.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: virtualization@lists.linux-foundation.org
> ---
>  drivers/block/virtio_blk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 1498b899a593..0ba1eb911a42 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -265,7 +265,7 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
>  	}
>  
>  	spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
> -	if (req_op(req) == REQ_OP_SCSI_IN || req_op(req) == REQ_OP_SCSI_OUT)
> +	if (blk_rq_is_scsi(req))
>  		err = virtblk_add_req_scsi(vblk->vqs[qid].vq, vbr, vbr->sg, num);
>  	else
>  		err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 09/12] virtio_blk: Use blk_rq_is_scsi()
  2017-08-17 23:23 ` Bart Van Assche
@ 2017-08-18  7:39   ` Hannes Reinecke
  2017-08-18  7:39   ` Hannes Reinecke
  1 sibling, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:39 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, virtualization, Christoph Hellwig, Michael S . Tsirkin

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> This patch does not change any functionality.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: virtualization@lists.linux-foundation.org
> ---
>  drivers/block/virtio_blk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 1498b899a593..0ba1eb911a42 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -265,7 +265,7 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
>  	}
>  
>  	spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
> -	if (req_op(req) == REQ_OP_SCSI_IN || req_op(req) == REQ_OP_SCSI_OUT)
> +	if (blk_rq_is_scsi(req))
>  		err = virtblk_add_req_scsi(vblk->vqs[qid].vq, vbr, vbr->sg, num);
>  	else
>  		err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 10/12] xen-blkback: Fix indentation
  2017-08-17 23:23   ` Bart Van Assche
  (?)
  (?)
@ 2017-08-18  7:40   ` Hannes Reinecke
  -1 siblings, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:40 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Konrad Rzeszutek Wilk,
	Roger Pau Monn303251, xen-devel

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> Avoid that smatch reports the following warning when building with
> C=2 CHECK="smatch -p=kernel":
> 
> drivers/block/xen-blkback/blkback.c:710 xen_blkbk_unmap_prepare() warn: inconsistent indenting
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>  drivers/block/xen-blkback/blkback.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> index fe7cd58c43d0..68157a84bf4d 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -705,9 +705,9 @@ static unsigned int xen_blkbk_unmap_prepare(
>  				    GNTMAP_host_map, pages[i]->handle);
>  		pages[i]->handle = BLKBACK_INVALID_HANDLE;
>  		invcount++;
> -       }
> +	}
>  
> -       return invcount;
> +	return invcount;
>  }
>  
>  static void xen_blkbk_unmap_and_respond_callback(int result, struct gntab_unmap_queue_data *data)
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 10/12] xen-blkback: Fix indentation
  2017-08-17 23:23   ` Bart Van Assche
  (?)
@ 2017-08-18  7:40   ` Hannes Reinecke
  -1 siblings, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:40 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, xen-devel, Roger Pau Monn303251, Christoph Hellwig

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> Avoid that smatch reports the following warning when building with
> C=2 CHECK="smatch -p=kernel":
> 
> drivers/block/xen-blkback/blkback.c:710 xen_blkbk_unmap_prepare() warn: inconsistent indenting
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>  drivers/block/xen-blkback/blkback.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> index fe7cd58c43d0..68157a84bf4d 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -705,9 +705,9 @@ static unsigned int xen_blkbk_unmap_prepare(
>  				    GNTMAP_host_map, pages[i]->handle);
>  		pages[i]->handle = BLKBACK_INVALID_HANDLE;
>  		invcount++;
> -       }
> +	}
>  
> -       return invcount;
> +	return invcount;
>  }
>  
>  static void xen_blkbk_unmap_and_respond_callback(int result, struct gntab_unmap_queue_data *data)
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 11/12] xen-blkback: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-17 23:23   ` Bart Van Assche
  (?)
@ 2017-08-18  7:40   ` Hannes Reinecke
  -1 siblings, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:40 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Konrad Rzeszutek Wilk,
	Roger Pau Monn303251, xen-devel

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>  drivers/block/xen-blkback/blkback.c | 1 +
>  drivers/block/xen-blkback/xenbus.c  | 3 ++-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> index 68157a84bf4d..5f3a813e7ae0 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -1251,6 +1251,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
>  		break;
>  	case BLKIF_OP_WRITE_BARRIER:
>  		drain = true;
> +		/* fall through */
>  	case BLKIF_OP_FLUSH_DISKCACHE:
>  		ring->st_f_req++;
>  		operation = REQ_OP_WRITE;
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index 792da683e70d..88eaea6475d7 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -810,7 +810,8 @@ static void frontend_changed(struct xenbus_device *dev,
>  		xenbus_switch_state(dev, XenbusStateClosed);
>  		if (xenbus_dev_is_online(dev))
>  			break;
> -		/* fall through if not online */
> +		/* fall through */
> +		/* if not online */
>  	case XenbusStateUnknown:
>  		/* implies xen_blkif_disconnect() via xen_blkbk_remove() */
>  		device_unregister(&dev->dev);
> 
Oh well, gcc again.

Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 11/12] xen-blkback: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-17 23:23   ` Bart Van Assche
  (?)
  (?)
@ 2017-08-18  7:40   ` Hannes Reinecke
  -1 siblings, 0 replies; 45+ messages in thread
From: Hannes Reinecke @ 2017-08-18  7:40 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, xen-devel, Roger Pau Monn303251, Christoph Hellwig

On 08/18/2017 01:23 AM, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>  drivers/block/xen-blkback/blkback.c | 1 +
>  drivers/block/xen-blkback/xenbus.c  | 3 ++-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> index 68157a84bf4d..5f3a813e7ae0 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -1251,6 +1251,7 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring,
>  		break;
>  	case BLKIF_OP_WRITE_BARRIER:
>  		drain = true;
> +		/* fall through */
>  	case BLKIF_OP_FLUSH_DISKCACHE:
>  		ring->st_f_req++;
>  		operation = REQ_OP_WRITE;
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index 792da683e70d..88eaea6475d7 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -810,7 +810,8 @@ static void frontend_changed(struct xenbus_device *dev,
>  		xenbus_switch_state(dev, XenbusStateClosed);
>  		if (xenbus_dev_is_online(dev))
>  			break;
> -		/* fall through if not online */
> +		/* fall through */
> +		/* if not online */
>  	case XenbusStateUnknown:
>  		/* implies xen_blkif_disconnect() via xen_blkbk_remove() */
>  		device_unregister(&dev->dev);
> 
Oh well, gcc again.

Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-17 23:23   ` Bart Van Assche
  (?)
  (?)
@ 2017-08-18  8:54   ` Roger Pau Monn303251
  2017-08-18 11:46       ` Anthony PERARD
  -1 siblings, 1 reply; 45+ messages in thread
From: Roger Pau Monn303251 @ 2017-08-18  8:54 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Jens Axboe, linux-block, Christoph Hellwig,
	Konrad Rzeszutek Wilk, xen-devel

On Thu, Aug 17, 2017 at 04:23:11PM -0700, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>  drivers/block/xen-blkfront.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 98e34e4c62b8..270019e3e5d8 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -2456,7 +2456,7 @@ static void blkback_changed(struct xenbus_device *dev,
>  	case XenbusStateClosed:
>  		if (dev->state == XenbusStateClosed)
>  			break;
> -		/* Missed the backend's Closing state -- fallthrough */
> +		/* fall through */

This is losing information present in the original comment. Would
splitting the comment into two make gcc happy?

Roger.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-17 23:23   ` Bart Van Assche
  (?)
@ 2017-08-18  8:54   ` Roger Pau Monn303251
  -1 siblings, 0 replies; 45+ messages in thread
From: Roger Pau Monn303251 @ 2017-08-18  8:54 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Jens Axboe, linux-block, xen-devel, Christoph Hellwig

On Thu, Aug 17, 2017 at 04:23:11PM -0700, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>  drivers/block/xen-blkfront.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 98e34e4c62b8..270019e3e5d8 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -2456,7 +2456,7 @@ static void blkback_changed(struct xenbus_device *dev,
>  	case XenbusStateClosed:
>  		if (dev->state == XenbusStateClosed)
>  			break;
> -		/* Missed the backend's Closing state -- fallthrough */
> +		/* fall through */

This is losing information present in the original comment. Would
splitting the comment into two make gcc happy?

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Xen-devel] [PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-18  8:54   ` Roger Pau Monn303251
@ 2017-08-18 11:46       ` Anthony PERARD
  0 siblings, 0 replies; 45+ messages in thread
From: Anthony PERARD @ 2017-08-18 11:46 UTC (permalink / raw)
  To: Roger Pau Monn303251
  Cc: Bart Van Assche, Jens Axboe, linux-block, xen-devel, Christoph Hellwig

On Fri, Aug 18, 2017 at 09:54:01AM +0100, Roger Pau Monn303251 wrote:
> On Thu, Aug 17, 2017 at 04:23:11PM -0700, Bart Van Assche wrote:
> > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> > Cc: xen-devel@lists.xenproject.org
> > ---
> >  drivers/block/xen-blkfront.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> > index 98e34e4c62b8..270019e3e5d8 100644
> > --- a/drivers/block/xen-blkfront.c
> > +++ b/drivers/block/xen-blkfront.c
> > @@ -2456,7 +2456,7 @@ static void blkback_changed(struct xenbus_device *dev,
> >  	case XenbusStateClosed:
> >  		if (dev->state == XenbusStateClosed)
> >  			break;
> > -		/* Missed the backend's Closing state -- fallthrough */
> > +		/* fall through */
> 
> This is losing information present in the original comment. Would
> splitting the comment into two make gcc happy?

What about:

-		/* Missed the backend's Closing state -- fallthrough */
+		/* fallthrough -- Missed the backend's Closing state */

FIY:
https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Warning-Options.html#index-Wimplicit-fallthrough

A dash seems to be needed between "fall through" and a extra comment,
with fallthrough first.

Regards,

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1
@ 2017-08-18 11:46       ` Anthony PERARD
  0 siblings, 0 replies; 45+ messages in thread
From: Anthony PERARD @ 2017-08-18 11:46 UTC (permalink / raw)
  To: Roger Pau Monn303251
  Cc: Bart Van Assche, Jens Axboe, linux-block, Christoph Hellwig, xen-devel

On Fri, Aug 18, 2017 at 09:54:01AM +0100, Roger Pau Monn303251 wrote:
> On Thu, Aug 17, 2017 at 04:23:11PM -0700, Bart Van Assche wrote:
> > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> > Cc: xen-devel@lists.xenproject.org
> > ---
> >  drivers/block/xen-blkfront.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> > index 98e34e4c62b8..270019e3e5d8 100644
> > --- a/drivers/block/xen-blkfront.c
> > +++ b/drivers/block/xen-blkfront.c
> > @@ -2456,7 +2456,7 @@ static void blkback_changed(struct xenbus_device *dev,
> >  	case XenbusStateClosed:
> >  		if (dev->state == XenbusStateClosed)
> >  			break;
> > -		/* Missed the backend's Closing state -- fallthrough */
> > +		/* fall through */
> 
> This is losing information present in the original comment. Would
> splitting the comment into two make gcc happy?

What about:

-		/* Missed the backend's Closing state -- fallthrough */
+		/* fallthrough -- Missed the backend's Closing state */

FIY:
https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Warning-Options.html#index-Wimplicit-fallthrough

A dash seems to be needed between "fall through" and a extra comment,
with fallthrough first.

Regards,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [Xen-devel] [PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-18 11:46       ` Anthony PERARD
  (?)
@ 2017-08-18 11:57       ` Roger Pau Monn303251
  -1 siblings, 0 replies; 45+ messages in thread
From: Roger Pau Monn303251 @ 2017-08-18 11:57 UTC (permalink / raw)
  To: Anthony PERARD
  Cc: Bart Van Assche, Jens Axboe, linux-block, xen-devel, Christoph Hellwig

On Fri, Aug 18, 2017 at 12:46:23PM +0100, Anthony PERARD wrote:
> On Fri, Aug 18, 2017 at 09:54:01AM +0100, Roger Pau Monn303251 wrote:
> > On Thu, Aug 17, 2017 at 04:23:11PM -0700, Bart Van Assche wrote:
> > > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > > Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> > > Cc: xen-devel@lists.xenproject.org
> > > ---
> > >  drivers/block/xen-blkfront.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> > > index 98e34e4c62b8..270019e3e5d8 100644
> > > --- a/drivers/block/xen-blkfront.c
> > > +++ b/drivers/block/xen-blkfront.c
> > > @@ -2456,7 +2456,7 @@ static void blkback_changed(struct xenbus_device *dev,
> > >  	case XenbusStateClosed:
> > >  		if (dev->state == XenbusStateClosed)
> > >  			break;
> > > -		/* Missed the backend's Closing state -- fallthrough */
> > > +		/* fall through */
> > 
> > This is losing information present in the original comment. Would
> > splitting the comment into two make gcc happy?
> 
> What about:
> 
> -		/* Missed the backend's Closing state -- fallthrough */
> +		/* fallthrough -- Missed the backend's Closing state */
> 
> FIY:
> https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Warning-Options.html#index-Wimplicit-fallthrough
> 
> A dash seems to be needed between "fall through" and a extra comment,
> with fallthrough first.

I think so, according to the documentation -Wimplicit-fallthrough=3 is
enabled with -Wextra, and requires having "fallthrough" first. Your
proposed change seems fine to me.

Roger.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1
  2017-08-18 11:46       ` Anthony PERARD
  (?)
  (?)
@ 2017-08-18 11:57       ` Roger Pau Monn303251
  -1 siblings, 0 replies; 45+ messages in thread
From: Roger Pau Monn303251 @ 2017-08-18 11:57 UTC (permalink / raw)
  To: Anthony PERARD
  Cc: Bart Van Assche, Jens Axboe, linux-block, Christoph Hellwig, xen-devel

On Fri, Aug 18, 2017 at 12:46:23PM +0100, Anthony PERARD wrote:
> On Fri, Aug 18, 2017 at 09:54:01AM +0100, Roger Pau Monn303251 wrote:
> > On Thu, Aug 17, 2017 at 04:23:11PM -0700, Bart Van Assche wrote:
> > > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > > Cc: Roger Pau Monn303251 <roger.pau@citrix.com>
> > > Cc: xen-devel@lists.xenproject.org
> > > ---
> > >  drivers/block/xen-blkfront.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> > > index 98e34e4c62b8..270019e3e5d8 100644
> > > --- a/drivers/block/xen-blkfront.c
> > > +++ b/drivers/block/xen-blkfront.c
> > > @@ -2456,7 +2456,7 @@ static void blkback_changed(struct xenbus_device *dev,
> > >  	case XenbusStateClosed:
> > >  		if (dev->state == XenbusStateClosed)
> > >  			break;
> > > -		/* Missed the backend's Closing state -- fallthrough */
> > > +		/* fall through */
> > 
> > This is losing information present in the original comment. Would
> > splitting the comment into two make gcc happy?
> 
> What about:
> 
> -		/* Missed the backend's Closing state -- fallthrough */
> +		/* fallthrough -- Missed the backend's Closing state */
> 
> FIY:
> https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Warning-Options.html#index-Wimplicit-fallthrough
> 
> A dash seems to be needed between "fall through" and a extra comment,
> with fallthrough first.

I think so, according to the documentation -Wimplicit-fallthrough=3 is
enabled with -Wextra, and requires having "fallthrough" first. Your
proposed change seems fine to me.

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented
  2017-08-17 23:23 ` [PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented Bart Van Assche
  2017-08-18  7:32   ` Hannes Reinecke
@ 2017-08-18 14:34   ` Jens Axboe
  1 sibling, 0 replies; 45+ messages in thread
From: Jens Axboe @ 2017-08-18 14:34 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-block, Christoph Hellwig, Hannes Reinecke, Johannes Thumshirn

On Thu, Aug 17 2017, Bart Van Assche wrote:
> It is nontrivial to derive from the blk-mq source code when
> blk_mq_tags.active_queues is decremented. Hence add a comment that
> explains this.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  block/blk-mq.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index f84d145490bf..b86d2cafc355 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -834,6 +834,10 @@ static void blk_mq_timeout_work(struct work_struct *work)
>  	} else {
>  		struct blk_mq_hw_ctx *hctx;
>  
> +		/*
> +		 * All requests finished (latest request timeout) seconds ago,
> +		 * so mark each hctx as idle.
> +		 */
>  		queue_for_each_hw_ctx(q, hctx, i) {

I don't think that's a great comment, what does 'latest request timeout'
refer to? We hit this case when the device has gone idle, I think a more
useful comment would be something about how blk-mq implements timeouts.
How about something ala:

/*
 * Request timeouts are handled as a forward rolling timer. If we
 * end up here, there are no more requests pending, and there hasn't
 * been for a while. Mark each hctx as idle.
 */

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables
  2017-08-17 23:23 ` [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables Bart Van Assche
  2017-08-18  7:38   ` Hannes Reinecke
@ 2017-08-18 14:35   ` Jens Axboe
  2017-08-18 15:11     ` Bart Van Assche
  1 sibling, 1 reply; 45+ messages in thread
From: Jens Axboe @ 2017-08-18 14:35 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-block, Christoph Hellwig, Omar Sandoval, Hannes Reinecke

On Thu, Aug 17 2017, Bart Van Assche wrote:
> It is easy to add a flag to one of the block layer headers and to
> forget to update blk-mq-debugfs.c. E.g. QUEUE_FLAG_SCSI_PASSTHROUGH,
> QUEUE_FLAG_QUIESCED and REQ_NOWAIT are missing from blk-mq-debugfs.c.
> Hence generate the symbol-to-text translation tables.

This is just too ugly to live...

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 00/12] Twelve small block layer patches
  2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
                   ` (12 preceding siblings ...)
  2017-08-17 23:23   ` Bart Van Assche
@ 2017-08-18 14:37 ` Jens Axboe
  13 siblings, 0 replies; 45+ messages in thread
From: Jens Axboe @ 2017-08-18 14:37 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: linux-block, Christoph Hellwig

On Thu, Aug 17 2017, Bart Van Assche wrote:
> Hello Jens,
> 
> The twelve patches in this series are patches I came up with while working
> on block drivers and SCSI drivers. Please consider these for inclusion in
> kernel v4.14.

I have applied the set for 4.14, except #3 and #6. Thanks Bart.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables
  2017-08-18 14:35   ` Jens Axboe
@ 2017-08-18 15:11     ` Bart Van Assche
  2017-08-18 15:36       ` Jens Axboe
  0 siblings, 1 reply; 45+ messages in thread
From: Bart Van Assche @ 2017-08-18 15:11 UTC (permalink / raw)
  To: axboe; +Cc: hch, linux-block, osandov, hare

T24gRnJpLCAyMDE3LTA4LTE4IGF0IDA4OjM1IC0wNjAwLCBKZW5zIEF4Ym9lIHdyb3RlOg0KPiBP
biBUaHUsIEF1ZyAxNyAyMDE3LCBCYXJ0IFZhbiBBc3NjaGUgd3JvdGU6DQo+ID4gSXQgaXMgZWFz
eSB0byBhZGQgYSBmbGFnIHRvIG9uZSBvZiB0aGUgYmxvY2sgbGF5ZXIgaGVhZGVycyBhbmQgdG8N
Cj4gPiBmb3JnZXQgdG8gdXBkYXRlIGJsay1tcS1kZWJ1Z2ZzLmMuIEUuZy4gUVVFVUVfRkxBR19T
Q1NJX1BBU1NUSFJPVUdILA0KPiA+IFFVRVVFX0ZMQUdfUVVJRVNDRUQgYW5kIFJFUV9OT1dBSVQg
YXJlIG1pc3NpbmcgZnJvbSBibGstbXEtZGVidWdmcy5jLg0KPiA+IEhlbmNlIGdlbmVyYXRlIHRo
ZSBzeW1ib2wtdG8tdGV4dCB0cmFuc2xhdGlvbiB0YWJsZXMuDQo+IA0KPiBUaGlzIGlzIGp1c3Qg
dG9vIHVnbHkgdG8gbGl2ZS4uLg0KDQpIZWxsbyBKZW5zLA0KDQpIb3cgYWJvdXQgYWRkaW5nIHJ1
bGVzIHRvIHRoZSBtYWtlZmlsZSB0aGF0IGNoZWNrIGZvciBtaXNzaW5nIHN5bWJvbHMgYW5kDQp0
aGF0IGlzc3VlIGEgd2FybmluZyBpZiBhIHN5bWJvbCBpcyBtaXNzaW5nIGZyb20gYmxrLW1xLWRl
YnVnZnMuYz8gV291bGQNCnlvdSBjb25zaWRlciB0aGF0IGFwcHJvYWNoIGFjY2VwdGFibGU/DQoN
CkJhcnQu

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables
  2017-08-18 15:11     ` Bart Van Assche
@ 2017-08-18 15:36       ` Jens Axboe
  0 siblings, 0 replies; 45+ messages in thread
From: Jens Axboe @ 2017-08-18 15:36 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: hch, linux-block, osandov, hare

On 08/18/2017 09:11 AM, Bart Van Assche wrote:
> On Fri, 2017-08-18 at 08:35 -0600, Jens Axboe wrote:
>> On Thu, Aug 17 2017, Bart Van Assche wrote:
>>> It is easy to add a flag to one of the block layer headers and to
>>> forget to update blk-mq-debugfs.c. E.g. QUEUE_FLAG_SCSI_PASSTHROUGH,
>>> QUEUE_FLAG_QUIESCED and REQ_NOWAIT are missing from blk-mq-debugfs.c.
>>> Hence generate the symbol-to-text translation tables.
>>
>> This is just too ugly to live...
> 
> Hello Jens,
> 
> How about adding rules to the makefile that check for missing symbols and
> that issue a warning if a symbol is missing from blk-mq-debugfs.c? Would
> you consider that approach acceptable?

If it's small and clean, I'd consider it. The problem with this
version is that it's massive and really nasty. It better be solving
a huge problem to warrant that, and it doesn't. It's really a minor
thing. I'd like to ensure that we keep them synced, but the solution
complexity has to match the problem.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: [PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read
  2017-08-17 23:23 ` [PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read Bart Van Assche
  2017-08-18  7:32   ` Hannes Reinecke
@ 2017-08-20  6:15   ` Sagi Grimberg
  1 sibling, 0 replies; 45+ messages in thread
From: Sagi Grimberg @ 2017-08-20  6:15 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, James Smart,
	Johannes Thumshirn

Looks fine to me,

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2017-08-20  6:15 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-17 23:22 [PATCH 00/12] Twelve small block layer patches Bart Van Assche
2017-08-17 23:23 ` [PATCH 01/12] block: Fix two comments that refer to .queue_rq() return values Bart Van Assche
2017-08-18  7:31   ` Hannes Reinecke
2017-08-17 23:23 ` [PATCH 02/12] block: Unexport blk_queue_end_tag() Bart Van Assche
2017-08-18  7:31   ` Hannes Reinecke
2017-08-17 23:23 ` [PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented Bart Van Assche
2017-08-18  7:32   ` Hannes Reinecke
2017-08-18 14:34   ` Jens Axboe
2017-08-17 23:23 ` [PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read Bart Van Assche
2017-08-18  7:32   ` Hannes Reinecke
2017-08-20  6:15   ` Sagi Grimberg
2017-08-17 23:23 ` [PATCH 05/12] blk-mq-debugfs: Declare a local symbol static Bart Van Assche
2017-08-18  6:52   ` Omar Sandoval
2017-08-18  7:33   ` Hannes Reinecke
2017-08-17 23:23 ` [PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables Bart Van Assche
2017-08-18  7:38   ` Hannes Reinecke
2017-08-18 14:35   ` Jens Axboe
2017-08-18 15:11     ` Bart Van Assche
2017-08-18 15:36       ` Jens Axboe
2017-08-17 23:23 ` [PATCH 07/12] genhd: Annotate all part and part_tbl pointer dereferences Bart Van Assche
2017-08-18  7:39   ` Hannes Reinecke
2017-08-17 23:23 ` [PATCH 08/12] ide-floppy: Use blk_rq_is_scsi() Bart Van Assche
2017-08-18  5:00   ` David Miller
2017-08-18  7:39   ` Hannes Reinecke
2017-08-17 23:23 ` [PATCH 09/12] virtio_blk: " Bart Van Assche
2017-08-17 23:23 ` Bart Van Assche
2017-08-18  7:39   ` Hannes Reinecke
2017-08-18  7:39   ` Hannes Reinecke
2017-08-17 23:23 ` [PATCH 10/12] xen-blkback: Fix indentation Bart Van Assche
2017-08-17 23:23   ` Bart Van Assche
2017-08-18  7:40   ` Hannes Reinecke
2017-08-18  7:40   ` Hannes Reinecke
2017-08-17 23:23 ` [PATCH 11/12] xen-blkback: Avoid that gcc 7 warns about fall-through when building with W=1 Bart Van Assche
2017-08-17 23:23   ` Bart Van Assche
2017-08-18  7:40   ` Hannes Reinecke
2017-08-18  7:40   ` Hannes Reinecke
2017-08-17 23:23 ` [PATCH 12/12] xen-blkfront: " Bart Van Assche
2017-08-17 23:23   ` Bart Van Assche
2017-08-18  8:54   ` Roger Pau Monn303251
2017-08-18  8:54   ` Roger Pau Monn303251
2017-08-18 11:46     ` [Xen-devel] " Anthony PERARD
2017-08-18 11:46       ` Anthony PERARD
2017-08-18 11:57       ` [Xen-devel] " Roger Pau Monn303251
2017-08-18 11:57       ` Roger Pau Monn303251
2017-08-18 14:37 ` [PATCH 00/12] Twelve small block layer patches Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.