projects
/
platform
/
kernel
/
linux-starfive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
KVM: s390/mm: Properly reset no-dat
[platform/kernel/linux-starfive.git]
/
block
/
blk-mq-sysfs.c
diff --git
a/block/blk-mq-sysfs.c
b/block/blk-mq-sysfs.c
index
93997d2
..
4515288
100644
(file)
--- a/
block/blk-mq-sysfs.c
+++ b/
block/blk-mq-sysfs.c
@@
-185,7
+185,7
@@
static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx)
{
struct request_queue *q = hctx->queue;
struct blk_mq_ctx *ctx;
{
struct request_queue *q = hctx->queue;
struct blk_mq_ctx *ctx;
- int i, ret;
+ int i,
j,
ret;
if (!hctx->nr_ctx)
return 0;
if (!hctx->nr_ctx)
return 0;
@@
-197,9
+197,16
@@
static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx)
hctx_for_each_ctx(hctx, ctx, i) {
ret = kobject_add(&ctx->kobj, &hctx->kobj, "cpu%u", ctx->cpu);
if (ret)
hctx_for_each_ctx(hctx, ctx, i) {
ret = kobject_add(&ctx->kobj, &hctx->kobj, "cpu%u", ctx->cpu);
if (ret)
-
break
;
+
goto out
;
}
}
+ return 0;
+out:
+ hctx_for_each_ctx(hctx, ctx, j) {
+ if (j < i)
+ kobject_del(&ctx->kobj);
+ }
+ kobject_del(&hctx->kobj);
return ret;
}
return ret;
}