block, bfq: fix error handle in bfq_init
Subsystems (2)
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
@@ -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
Quoted 28 lines · weiping zhang
if
elv_registerfail,bfq_poolshould be free.Signed-off-by weiping zhang <[email protected]>--- block/bfq-iosched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)block/bfq-iosched.c +3
-1@@ -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
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_registerfail,bfq_poolshould be free.
=20Signed-off-by weiping zhang <[email protected]>---
block/bfq-iosched.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)=20
block/bfq-iosched.c +0
-0@@ -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:
#ifdefCONFIG_BFQ_GROUP_IOSCHED
Quoted 8 lines
Quoted 4 lines
blkcg_policy_unregister(&blkcg_policy_bfq);--=20
2.9.4
=20Hi 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
Jens Axboe
maintainerQuoted 1 line · weiping zhang
if
elv_registerfail,bfq_poolshould be free.
Looks correct to me, I'll add it. Thanks.
Signature · 1 line
Jens Axboe
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_registerfail,bfq_poolshould be free.=20
Looks correct to me, I'll add it. Thanks.
=20
--=20
Jens Axboe
=20
Jens,
Thanks a lot=