Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1663068 > unrolled thread
| Started by | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| First post | 2017-06-11 09:30 +0200 |
| Last post | 2017-06-12 13:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-06-11 09:30 +0200
Re: [PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super' Chao Yu <yuchao0@huawei.com> - 2017-06-12 13:00 +0200
| From | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| Date | 2017-06-11 09:30 +0200 |
| Subject | [PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super' |
| Message-ID | <tR5tT-29D-1@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Chao Yu <yuchao0@huawei.com> |
|---|---|
| Date | 2017-06-12 13:00 +0200 |
| Subject | Re: [PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super' |
| Message-ID | <tRveF-13J-1@gated-at.bofh.it> |
| In reply to | #1663068 |
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);
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web