Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-10-18 12:12:51 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-10-18 12:12:51 +0200
commit84d3e5982d3567bbbde2f6f9fce83ceb2661e5d9 (patch)
treeaf39f0d590e989376fac98ba5e1766969d1543d1
parentc961a242398a30507f9164f44ce93ff7d4916825 (diff)
parent1dbb9c3a0deb7e4c413680de0e6e8a39197a31f9 (diff)
Merge branch 'users/tabraham/SLE15/for-next' into SLE15
Pull a block layer fix from Thomas Abraham
-rw-r--r--patches.suse/block-add-io-timeout-to-sysfs.patch72
-rw-r--r--patches.suse/block-don-t-show-io_timeout-if-driver-has-no-timeout.patch84
-rw-r--r--series.conf2
3 files changed, 158 insertions, 0 deletions
diff --git a/patches.suse/block-add-io-timeout-to-sysfs.patch b/patches.suse/block-add-io-timeout-to-sysfs.patch
new file mode 100644
index 0000000000..7794d613f4
--- /dev/null
+++ b/patches.suse/block-add-io-timeout-to-sysfs.patch
@@ -0,0 +1,72 @@
+From 65cd1d13b880920054d6c750679baa80b7f9c072 Mon Sep 17 00:00:00 2001
+From: Weiping Zhang <zhangweiping@didiglobal.com>
+Date: Thu, 29 Nov 2018 00:04:39 +0800
+Subject: [PATCH] block: add io timeout to sysfs
+References: bsc#1148410
+Git-commit: 65cd1d13b880920054d6c750679baa80b7f9c072
+Patch-mainline: v5.0-rc1
+
+Give a interface to adjust io timeout(ms) by device.
+
+Signed-off-by: Weiping Zhang <zhangweiping@didiglobal.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Thomas Abraham <tabraham@suse.com>
+---
+ block/blk-sysfs.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
+index 80eef48fddc8..9f0cb370b39b 100644
+--- a/block/blk-sysfs.c
++++ b/block/blk-sysfs.c
+@@ -417,6 +417,26 @@ static ssize_t queue_poll_store(struct request_queue *q, const char *page,
+ return ret;
+ }
+
++static ssize_t queue_io_timeout_show(struct request_queue *q, char *page)
++{
++ return sprintf(page, "%u\n", jiffies_to_msecs(q->rq_timeout));
++}
++
++static ssize_t queue_io_timeout_store(struct request_queue *q, const char *page,
++ size_t count)
++{
++ unsigned int val;
++ int err;
++
++ err = kstrtou32(page, 10, &val);
++ if (err || val == 0)
++ return -EINVAL;
++
++ blk_queue_rq_timeout(q, msecs_to_jiffies(val));
++
++ return count;
++}
++
+ static ssize_t queue_wb_lat_show(struct request_queue *q, char *page)
+ {
+ if (!q->rq_wb)
+@@ -685,6 +705,12 @@ static struct queue_sysfs_entry queue_dax_entry = {
+ .show = queue_dax_show,
+ };
+
++static struct queue_sysfs_entry queue_io_timeout_entry = {
++ .attr = {.name = "io_timeout", .mode = 0644 },
++ .show = queue_io_timeout_show,
++ .store = queue_io_timeout_store,
++};
++
+ static struct queue_sysfs_entry queue_wb_lat_entry = {
+ .attr = {.name = "wbt_lat_usec", .mode = S_IRUGO | S_IWUSR },
+ .show = queue_wb_lat_show,
+@@ -734,6 +760,7 @@ static struct attribute *default_attrs[] = {
+ &queue_dax_entry.attr,
+ &queue_wb_lat_entry.attr,
+ &queue_poll_delay_entry.attr,
++ &queue_io_timeout_entry.attr,
+ #ifdef CONFIG_BLK_DEV_THROTTLING_LOW
+ &throtl_sample_time_entry.attr,
+ #endif
+--
+2.16.4
+
diff --git a/patches.suse/block-don-t-show-io_timeout-if-driver-has-no-timeout.patch b/patches.suse/block-don-t-show-io_timeout-if-driver-has-no-timeout.patch
new file mode 100644
index 0000000000..e698b7e276
--- /dev/null
+++ b/patches.suse/block-don-t-show-io_timeout-if-driver-has-no-timeout.patch
@@ -0,0 +1,84 @@
+From 4d25339e32a1b6e1f490bb78b1e5b0fa9eb3e073 Mon Sep 17 00:00:00 2001
+From: Weiping Zhang <zhangweiping@didiglobal.com>
+Date: Tue, 2 Apr 2019 21:14:30 +0800
+Subject: [PATCH] block: don't show io_timeout if driver has no timeout handler
+References: bsc#1148410
+Git-commit: 4d25339e32a1b6e1f490bb78b1e5b0fa9eb3e073
+Patch-mainline: v5.2-rc1
+
+If the low level driver has no timeout handler, the
+/sys/block/<disk>/queue/io_timeout will not be displayed.
+
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Weiping Zhang <zhangweiping@didiglobal.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Thomas Abraham <tabraham@suse.com>
+---
+ block/blk-sysfs.c | 30 ++++++++++++++++++++++++++++--
+ 1 file changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
+index 422327089e0f..a16a02c52a85 100644
+--- a/block/blk-sysfs.c
++++ b/block/blk-sysfs.c
+@@ -728,7 +728,7 @@ static struct queue_sysfs_entry throtl_sample_time_entry = {
+ };
+ #endif
+
+-static struct attribute *default_attrs[] = {
++static struct attribute *queue_attrs[] = {
+ &queue_requests_entry.attr,
+ &queue_ra_entry.attr,
+ &queue_max_hw_sectors_entry.attr,
+@@ -770,6 +770,25 @@ static struct attribute *default_attrs[] = {
+ NULL,
+ };
+
++static umode_t queue_attr_visible(struct kobject *kobj, struct attribute *attr,
++ int n)
++{
++ struct request_queue *q =
++ container_of(kobj, struct request_queue, kobj);
++
++ if (attr == &queue_io_timeout_entry.attr &&
++ (!q->mq_ops || !q->mq_ops->timeout))
++ return 0;
++
++ return attr->mode;
++}
++
++static struct attribute_group queue_attr_group = {
++ .attrs = queue_attrs,
++ .is_visible = queue_attr_visible,
++};
++
++
+ #define to_queue(atr) container_of((atr), struct queue_sysfs_entry, attr)
+
+ static ssize_t
+@@ -890,7 +909,6 @@ static const struct sysfs_ops queue_sysfs_ops = {
+
+ struct kobj_type blk_queue_ktype = {
+ .sysfs_ops = &queue_sysfs_ops,
+- .default_attrs = default_attrs,
+ .release = blk_release_queue,
+ };
+
+@@ -939,6 +957,14 @@ int blk_register_queue(struct gendisk *disk)
+ goto unlock;
+ }
+
++ ret = sysfs_create_group(&q->kobj, &queue_attr_group);
++ if (ret) {
++ blk_trace_remove_sysfs(dev);
++ kobject_del(&q->kobj);
++ kobject_put(&dev->kobj);
++ goto unlock;
++ }
++
+ if (q->mq_ops) {
+ __blk_mq_register_dev(dev, q);
+ blk_mq_debugfs_register(q);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index b7caa5dcf5..72544815fe 100644
--- a/series.conf
+++ b/series.conf
@@ -21308,6 +21308,7 @@
patches.suse/ext4-include-terminating-u32-in-size-of-xattr-entrie.patch
patches.suse/ext4-force-inode-writes-when-nfsd-calls-commit_metad.patch
patches.suse/ext4-check-for-shutdown-and-r-o-file-system-in-ext4_.patch
+ patches.suse/block-add-io-timeout-to-sysfs.patch
patches.suse/0263-bcache-add-comment-for-cache_set-fill_iter.patch
patches.suse/0264-bcache-do-not-check-if-debug-dentry-is-ERR-or-NULL-e.patch
patches.suse/0265-bcache-update-comment-for-bch_data_insert.patch
@@ -23098,6 +23099,7 @@
patches.suse/Revert-ide-unexport-DISK_EVENT_MEDIA_CHANGE-for-i.patch
patches.suse/Revert-block-unexport-DISK_EVENT_MEDIA_CHANGE-for.patch
patches.suse/block-check_events-don-t-bother-with-events-if-un.patch
+ patches.suse/block-don-t-show-io_timeout-if-driver-has-no-timeout.patch
patches.suse/block-fix-use-after-free-on-gendisk.patch
patches.suse/md-raid-raid5-preserve-the-writeback-action-after-th.patch
patches.suse/0001-bcache-fix-crashes-stopping-bcache-device-before-rea.patch