Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730496 > unrolled thread

[PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-09-11 21:50 +0200
Last post2017-09-11 22:20 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-09-11 21:50 +0200
    Re: [PATCH] mm/backing-dev.c: fix an error handling path in  'cgwb_create()' Jens Axboe <axboe@kernel.dk> - 2017-09-11 22:00 +0200
      Re: [PATCH] mm/backing-dev.c: fix an error handling path in  'cgwb_create()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-09-11 22:10 +0200
        Re: [PATCH] mm/backing-dev.c: fix an error handling path in  'cgwb_create()' Jens Axboe <axboe@kernel.dk> - 2017-09-11 22:10 +0200
    Re: [PATCH] mm/backing-dev.c: fix an error handling path in  'cgwb_create()' Jan Kara <jack@suse.cz> - 2017-09-11 22:20 +0200
      Re: [PATCH] mm/backing-dev.c: fix an error handling path in  'cgwb_create()' Jens Axboe <axboe@kernel.dk> - 2017-09-11 22:20 +0200

#1730496 — [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-09-11 21:50 +0200
Subject[PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Message-ID<uoCSt-7IE-9@gated-at.bofh.it>
If the 'kmalloc' fails, we must go through the existing error handling
path.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 mm/backing-dev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index f028a9a472fd..e19606bb41a0 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -569,8 +569,10 @@ static int cgwb_create(struct backing_dev_info *bdi,
 
 	/* need to create a new one */
 	wb = kmalloc(sizeof(*wb), gfp);
-	if (!wb)
-		return -ENOMEM;
+	if (!wb) {
+		ret = -ENOMEM;
+		goto out_put;
+	}
 
 	ret = wb_init(wb, bdi, blkcg_css->id, gfp);
 	if (ret)
-- 
2.11.0

[toc] | [next] | [standalone]


#1730513 — Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

FromJens Axboe <axboe@kernel.dk>
Date2017-09-11 22:00 +0200
SubjectRe: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Message-ID<uoD2b-7Me-43@gated-at.bofh.it>
In reply to#1730496
On 09/11/2017 01:43 PM, Christophe JAILLET wrote:
> If the 'kmalloc' fails, we must go through the existing error handling
> path.

Looks good to me, probably wants a

Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")

line as well.

-- 
Jens Axboe

[toc] | [prev] | [next] | [standalone]


#1730519 — Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-09-11 22:10 +0200
SubjectRe: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Message-ID<uoDbQ-84z-13@gated-at.bofh.it>
In reply to#1730513
Le 11/09/2017 à 21:52, Jens Axboe a écrit :
> On 09/11/2017 01:43 PM, Christophe JAILLET wrote:
>> If the 'kmalloc' fails, we must go through the existing error handling
>> path.
> Looks good to me, probably wants a
>
> Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
>
> line as well.
>
Hi,

do you want me to resend with the Fixes tag? Or will it be added if merged?

CJ

[toc] | [prev] | [next] | [standalone]


#1730520 — Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

FromJens Axboe <axboe@kernel.dk>
Date2017-09-11 22:10 +0200
SubjectRe: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Message-ID<uoDbQ-84z-15@gated-at.bofh.it>
In reply to#1730519
On 09/11/2017 02:04 PM, Christophe JAILLET wrote:
> Le 11/09/2017 à 21:52, Jens Axboe a écrit :
>> On 09/11/2017 01:43 PM, Christophe JAILLET wrote:
>>> If the 'kmalloc' fails, we must go through the existing error handling
>>> path.
>> Looks good to me, probably wants a
>>
>> Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
>>
>> line as well.
>>
> Hi,
> 
> do you want me to resend with the Fixes tag? Or will it be added if merged?

Shouldn't be necessary to resend. Not sure who will queue it up, mm/ always
ends up being somewhat of a no-mans-land :-)

-- 
Jens Axboe

[toc] | [prev] | [next] | [standalone]


#1730531 — Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

FromJan Kara <jack@suse.cz>
Date2017-09-11 22:20 +0200
SubjectRe: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Message-ID<uoDlv-87V-9@gated-at.bofh.it>
In reply to#1730496
On Mon 11-09-17 21:43:23, Christophe JAILLET wrote:
> If the 'kmalloc' fails, we must go through the existing error handling
> path.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  mm/backing-dev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> index f028a9a472fd..e19606bb41a0 100644
> --- a/mm/backing-dev.c
> +++ b/mm/backing-dev.c
> @@ -569,8 +569,10 @@ static int cgwb_create(struct backing_dev_info *bdi,
>  
>  	/* need to create a new one */
>  	wb = kmalloc(sizeof(*wb), gfp);
> -	if (!wb)
> -		return -ENOMEM;
> +	if (!wb) {
> +		ret = -ENOMEM;
> +		goto out_put;
> +	}
>  
>  	ret = wb_init(wb, bdi, blkcg_css->id, gfp);
>  	if (ret)
> -- 
> 2.11.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

[toc] | [prev] | [next] | [standalone]


#1730532 — Re: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'

FromJens Axboe <axboe@kernel.dk>
Date2017-09-11 22:20 +0200
SubjectRe: [PATCH] mm/backing-dev.c: fix an error handling path in 'cgwb_create()'
Message-ID<uoDlv-87V-13@gated-at.bofh.it>
In reply to#1730531
On 09/11/2017 02:15 PM, Jan Kara wrote:
> On Mon 11-09-17 21:43:23, Christophe JAILLET wrote:
>> If the 'kmalloc' fails, we must go through the existing error handling
>> path.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> Looks good to me. You can add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>

I'll queue it up, with your reviewed-by added. Thanks.

-- 
Jens Axboe

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web