From patchwork Tue May 28 22:35:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 2627201 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by patchwork2.kernel.org (Postfix) with ESMTP id D37EBDFB78 for ; Tue, 28 May 2013 22:36:20 +0000 (UTC) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r4SMZkMP000607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 May 2013 22:35:46 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r4SMZgNl012346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 May 2013 22:35:43 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1UhSUY-0006sm-QN; Tue, 28 May 2013 15:35:42 -0700 Received: from ucsinet21.oracle.com ([156.151.31.93]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1UhSUI-0006rv-CZ for ocfs2-devel@oss.oracle.com; Tue, 28 May 2013 15:35:26 -0700 Received: from userp1030.oracle.com (userp1030.oracle.com [156.151.31.80]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r4SMZPqW003209 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 May 2013 22:35:26 GMT Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by userp1030.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r4SMXADC020724 for ; Tue, 28 May 2013 22:33:10 GMT Received: from akpm3.mtv.corp.google.com (unknown [216.239.45.95]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 94EC4ABD; Tue, 28 May 2013 22:35:24 +0000 (UTC) Date: Tue, 28 May 2013 15:35:23 -0700 From: Andrew Morton To: xiaowei.hu@oracle.com Message-Id: <20130528153523.f8d9d1a3aca72f857d72e185@linux-foundation.org> In-Reply-To: <1369186996-7127-1-git-send-email-xiaowei.hu@oracle.com> References: <1369186996-7127-1-git-send-email-xiaowei.hu@oracle.com> X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=140.211.169.12 ct-class=T1 ct-vol1=0 ct-vol2=4 ct-vol3=4 ct-risk=10 ct-spam1=0 ct-spam2=1 ct-bulk=90 rcpts=1 size=1879 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=HY8tEE08 c=1 sm=1 tr=0 a=5MPDoNpceV4HFXFrvkM3CQ==:117 a=5MPDoNpceV4HFXFrvkM3CQ==:17 a=bYuvF-UGv2AA:10 a=NEiEQogP1MkA:10 a=kj9zAlcOel0A:10 a=Z4Rwk6OoAAAA:8 a=1XWaLZrsAAAA:8 a=ag1SF4gXAAAA:8 a=5mBw1ioNGG8A:10 a=yPCof4ZbAAAA:8 a=i0 EeH86SAAAA:8 a=pGLkceISAAAA:8 a=iox4zFpeAAAA:8 a=IXr_WNlcAAAA:8 a=UolJqQZ99kwVz7GUfL0A:9 a=CjuIK1q_8ugA:10 a=7DSvI1NPTFQA:10 a=hPjdaMEvmhQA:10 a=MSl-tDqOz04A:10 a=n9GBPR9yFnkA:10 a=T5ZRoNnfl4MA:10 a=jbrJJM5MRmoA:10 X-Sendmail-CT-Classification: not spam X-Sendmail-CT-RefID: str=0001.0A090204.51A5312D.0126:SCFSTAT19734153, ss=1, re=-4.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Cc: joe.jin@oracle.com, ocfs2-devel@oss.oracle.com Subject: Re: [Ocfs2-devel] [PATCH] ocfs2_prep_new_orphaned_file should return ret X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] On Wed, 22 May 2013 09:43:16 +0800 xiaowei.hu@oracle.com wrote: > From: "Xiaowei.Hu" > > --- > fs/ocfs2/namei.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c > index 50c93a8..422cbe0 100644 > --- a/fs/ocfs2/namei.c > +++ b/fs/ocfs2/namei.c > @@ -2216,7 +2216,7 @@ out: > > brelse(orphan_dir_bh); > > - return 0; > + return ret; > } > > int ocfs2_create_inode_in_orphan(struct inode *dir, The patch is missing your signed-off-by. I added it - please confirm this is OK. I also pulled together a changelog based on the discussion. Please do provide good changelogs. From: "Xiaowei.Hu" Subject: ocfs2: ocfs2_prep_new_orphaned_file() should return ret If an error occurs, for example an EIO in __ocfs2_prepare_orphan_dir, ocfs2_prep_new_orphaned_file will release the inode_ac, then when the caller of ocfs2_prep_new_orphaned_file gets a 0 return, it will refer to a NULL ocfs2_alloc_context struct in the following functions. A kernel panic happens. Signed-off-by: "Xiaowei.Hu" Reviewed-by: shencanquan Acked-by: Sunil Mushran Cc: Joe Jin Cc: Mark Fasheh Cc: Joel Becker Signed-off-by: Andrew Morton --- fs/ocfs2/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN fs/ocfs2/namei.c~ocfs2-ocfs2_prep_new_orphaned_file-should-return-ret fs/ocfs2/namei.c --- a/fs/ocfs2/namei.c~ocfs2-ocfs2_prep_new_orphaned_file-should-return-ret +++ a/fs/ocfs2/namei.c @@ -2216,7 +2216,7 @@ out: brelse(orphan_dir_bh); - return 0; + return ret; } int ocfs2_create_inode_in_orphan(struct inode *dir,