Skip to contentSkip to conversation

block, bfq: fix error handle in bfq_init

PATCH In review weiping zhang 4 participants 5 messages Aug 18, 2017 – Aug 30, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block, bfq: fix error handle in bfq_init

if elv_register fail, bfq_pool should be free.

---
 block/bfq-iosched.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
block/bfq-iosched.c +3 -1
index 436b6ca..bdb072f 100644
@@ -5048,10 +5048,12 @@ static int __init bfq_init(void)
 
 	ret = elv_register(&iosched_bfq_mq);
 	if (ret)
-		goto err_pol_unreg;
+		goto slab_kill;
 
 	return 0;
 
+slab_kill:
+	bfq_slab_kill();
 err_pol_unreg:
 #ifdef CONFIG_BFQ_GROUP_IOSCHED
 	blkcg_policy_unregister(&blkcg_policy_bfq);
Signature · 1 line
2.9.4
#1 lore raw
Quoted 28 lines · weiping zhang

if elv_register fail, bfq_pool should be free.

---
 block/bfq-iosched.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
block/bfq-iosched.c +3 -1
index 436b6ca..bdb072f 100644
@@ -5048,10 +5048,12 @@ static int __init bfq_init(void)
 
 	ret = elv_register(&iosched_bfq_mq);
 	if (ret)
-		goto err_pol_unreg;
+		goto slab_kill;
 
 	return 0;
 
+slab_kill:
+	bfq_slab_kill();
 err_pol_unreg:
 #ifdef CONFIG_BFQ_GROUP_IOSCHED
 	blkcg_policy_unregister(&blkcg_policy_bfq);
Signature · 1 line
2.9.4

Hi Paolo, Jens,

could you give some comments for this patch ?

Thanks

#2 lore raw
Quoted 2 lines

Il giorno 23 ago 2017, alle ore 17:25, weiping zhang =

<[email protected]> ha scritto:

Quoted 26 lines

=20

Quoted 24 lines · weiping zhang

if elv_register fail, bfq_pool should be free.
=20

---
block/bfq-iosched.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)

=20

block/bfq-iosched.c +0 -0
index 436b6ca..bdb072f 100644
@@ -5048,10 +5048,12 @@ static int __init bfq_init(void)

=20

	ret =3D elv_register(&iosched_bfq_mq);
	if (ret)
block/bfq-iosched.c +1 -1
-		goto err_pol_unreg;
+		goto slab_kill;

=20

	return 0;

=20

block/bfq-iosched.c +2 -0
+slab_kill:
+	bfq_slab_kill();

err_pol_unreg:
#ifdef CONFIG_BFQ_GROUP_IOSCHED

Quoted 8 lines
Quoted 4 lines
	blkcg_policy_unregister(&blkcg_policy_bfq);

--=20
2.9.4
=20

Hi Paolo, Jens,
=20
could you give some comments for this patch ?
=20

Sorry for not making it in time (vacation), and thanks for fixing this bug.

Paolo

Quoted 1 line

Thanks

maintainer
#3 lore raw
In reply to weiping zhang
Quoted 1 line · weiping zhang

if elv_register fail, bfq_pool should be free.

Looks correct to me, I'll add it. Thanks.

Signature · 1 line
Jens Axboe
#4 lore raw
Quoted 2 lines

=D4=DA 2017=C4=EA8=D4=C224=C8=D5=A3=AC05:35=A3=ACJens Axboe =

<[email protected]> =D0=B4=B5=C0=A3=BA

Quoted 9 lines

=20

Quoted 1 line · weiping zhang

if elv_register fail, bfq_pool should be free.

=20
Looks correct to me, I'll add it. Thanks.
=20
--=20
Jens Axboe
=20

Jens,

Thanks a lot=