linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super'
@ 2017-06-11  7:21 Christophe JAILLET
  2017-06-12 11:03 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-06-11  7:21 UTC (permalink / raw)
  To: jaegeuk, yuchao0
  Cc: linux-f2fs-devel, linux-kernel, kernel-janitors, Christophe JAILLET

err must be set to -ENOMEM, otherwise we return 0.

Fixes: a912b54d3aaa0 ("f2fs: split bio cache")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 fs/f2fs/super.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 5be27eacea99..38f1624ac5dc 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1976,8 +1976,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 
 		sbi->write_io[i] = kmalloc(n * sizeof(struct f2fs_bio_info),
 								GFP_KERNEL);
-		if (!sbi->write_io[i])
+		if (!sbi->write_io[i]) {
+			err = -ENOMEM;
 			goto free_options;
+		}
 
 		for (j = HOT; j < n; j++) {
 			init_rwsem(&sbi->write_io[i][j].io_rwsem);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super'
  2017-06-11  7:21 [PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super' Christophe JAILLET
@ 2017-06-12 11:03 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2017-06-12 11:03 UTC (permalink / raw)
  To: Christophe JAILLET, jaegeuk
  Cc: linux-f2fs-devel, linux-kernel, kernel-janitors

On 2017/6/11 15:21, Christophe JAILLET wrote:
> err must be set to -ENOMEM, otherwise we return 0.
> 
> Fixes: a912b54d3aaa0 ("f2fs: split bio cache")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> ---
>  fs/f2fs/super.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 5be27eacea99..38f1624ac5dc 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -1976,8 +1976,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
>  
>  		sbi->write_io[i] = kmalloc(n * sizeof(struct f2fs_bio_info),
>  								GFP_KERNEL);
> -		if (!sbi->write_io[i])
> +		if (!sbi->write_io[i]) {
> +			err = -ENOMEM;
>  			goto free_options;
> +		}
>  
>  		for (j = HOT; j < n; j++) {
>  			init_rwsem(&sbi->write_io[i][j].io_rwsem);
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-12 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-11  7:21 [PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super' Christophe JAILLET
2017-06-12 11:03 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).