From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maneesh Soni Subject: Re: sys_uselib in exec.c Date: Wed, 24 Mar 2004 10:59:56 +0530 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040324052956.GA1364@in.ibm.com> References: <1080093909.2030.3.camel@zaphod> Reply-To: maneesh@in.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from e32.co.us.ibm.com ([32.97.110.130]:641 "EHLO e32.co.us.ibm.com") by vger.kernel.org with ESMTP id S263006AbUCXF0C (ORCPT ); Wed, 24 Mar 2004 00:26:02 -0500 To: Shaya Potter Content-Disposition: inline In-Reply-To: <1080093909.2030.3.camel@zaphod> List-Id: linux-fsdevel.vger.kernel.org On Wed, Mar 24, 2004 at 02:05:55AM +0000, Shaya Potter wrote: > the code there is (2.6.1) > > 125 error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, > &nd); > 126 if (error) > 127 goto out; > 128 > 129 error = -EINVAL; > 130 if (!S_ISREG(nd.dentry->d_inode->i_mode)) > 131 goto exit; > 132 > 133 error = permission(nd.dentry->d_inode, MAY_READ | MAY_EXEC, > &nd); > 134 if (error) > 135 goto exit; > 136 > 137 file = dentry_open(nd.dentry, nd.mnt, O_RDONLY); > 138 error = PTR_ERR(file); > 139 if (IS_ERR(file)) > 140 goto out; > > where exit does a path_release(&nd) and return's error while out just > returns error. > > if dentry_open fails, we don't call path_release(&nd). Is this correct? dentry_open, cleans up dentry and mnt if it has to return error.. Maneesh -- Maneesh Soni Linux Technology Center, IBM Software Lab, Bangalore, India email: maneesh@in.ibm.com Phone: 91-80-25044999 Fax: 91-80-25268553 T/L : 9243696