From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbdFLK73 (ORCPT ); Mon, 12 Jun 2017 06:59:29 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7372 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509AbdFLK72 (ORCPT ); Mon, 12 Jun 2017 06:59:28 -0400 Subject: Re: [PATCH] f2fs: Fix a return value in case of error in 'f2fs_fill_super' To: Christophe JAILLET , References: <20170611072111.2293-1-christophe.jaillet@wanadoo.fr> CC: , , From: Chao Yu Message-ID: Date: Mon, 12 Jun 2017 19:03:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20170611072111.2293-1-christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.593E7405.001E,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: faacdaab4175802a3f0dafe043f1468b Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Chao Yu 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); >