bdi: fix cleanup when fail to percpu_counter_init
Subsystems (2)
PATCH 1/1 bdi: fix cleanup when fail to percpu_counter_init
when percpu_counter_init fail at i, 0 ~ (i-1) should be destoried, not 1 ~ i.
--- mm/backing-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/backing-dev.c +1 -1
@@ -334,7 +334,7 @@ static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,return 0 ; out_destroy_stat: -while (i--) +while (--i >=0 )percpu_counter_destroy (&wb->stat[i]);fprop_local_destroy_percpu (&wb->completions); out_put_cong:
Signature · 7 lines
2.9.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · weiping zhang
when
percpu_counter_initfail at i, 0 ~ (i-1) should be destoried, not 1 ~ i.Signed-off-by weiping zhang <[email protected]>
Good catch. You can add:
Honza
Quoted 20 lines
--- mm/backing-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/backing-dev.c +1
-1@@ -334,7 +334,7 @@ static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,return 0 ; out_destroy_stat: -while (i--) +while (--i >=0 )percpu_counter_destroy (&wb->stat[i]);fprop_local_destroy_percpu (&wb->completions); out_put_cong:Signature · 1 line
2.9.4
Signature · 8 lines
Jan Kara <[email protected]> SUSE Labs, CR -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 13 lines · weiping zhang
when
percpu_counter_initfail at i, 0 ~ (i-1) should be destoried, not 1 ~ i.Signed-off-by weiping zhang <[email protected]>--- mm/backing-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/backing-dev.c +0
-0
mm/backing-dev.c static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi, · line 337
Quoted 5 lines
mm/backing-dev.c +1
-1@@ -334,7 +334,7 @@ static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,return 0 ; out_destroy_stat: -while (i--) +while (--i >=0 )
These two constructs will produce identical results.
Signature · 7 lines
Jens Axboe -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 16 lines · Jens Axboe
Quoted 15 lines · weiping zhang
when
percpu_counter_initfail at i, 0 ~ (i-1) should be destoried, not 1 ~ i.Signed-off-by weiping zhang <[email protected]>--- mm/backing-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/backing-dev.c +0
-0@@ -334,7 +334,7 @@ static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,return 0 ;
Quoted 5 lines
mm/backing-dev.c static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi, · line 337
Quoted 3 lines
mm/backing-dev.c +1
-1out_destroy_stat: -while (i--) +while (--i >=0 )These two constructs will produce identical results.
Bah, you are correct. I got confused.
Honza
Signature · 8 lines
Jan Kara <[email protected]> SUSE Labs, CR -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 17 lines · Jan Kara
Quoted 16 lines · Jens Axboe
Quoted 15 lines · weiping zhang
when
percpu_counter_initfail at i, 0 ~ (i-1) should be destoried, not 1 ~ i.Signed-off-by weiping zhang <[email protected]>--- mm/backing-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/backing-dev.c +0
-0@@ -334,7 +334,7 @@ static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,return 0 ;
Quoted 8 lines
Quoted 5 lines
mm/backing-dev.c static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi, · line 337
Quoted 3 lines
mm/backing-dev.c +1
-1out_destroy_stat: -while (i--) +while (--i >=0 )These two constructs will produce identical results.
Bah, you are correct. I got confused.
It's my fault, thanks all of you, ^_^
weiping
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>