From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: [PATCH 004 of 18] knfsd: nfsd: make exp_rootfh handle exp_parent errors Date: Fri, 8 Dec 2006 12:13:41 +1100 Message-ID: <1061208011341.30603@suse.de> References: <20061208120939.30428.patches@notabene> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: nfs@lists.sourceforge.net, linux-kernel@vger.kernel.org Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp (Exim 4.43) id 1GsUIt-00037M-3H for nfs@lists.sourceforge.net; Thu, 07 Dec 2006 17:13:31 -0800 Received: from cantor2.suse.de ([195.135.220.15] helo=mx2.suse.de) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1GsUIs-0004rl-WC for nfs@lists.sourceforge.net; Thu, 07 Dec 2006 17:13:32 -0800 To: Andrew Morton List-Id: "Discussion of NFS under Linux development, interoperability, and testing." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfs-bounces@lists.sourceforge.net Errors-To: nfs-bounces@lists.sourceforge.net From: J.Bruce Fields Since exp_parent can fail by returning an error (-EAGAIN) in addition to by returning NULL, we should check for that case in exp_rootfh. (TODO: we should check that userland handles these errors too.) Signed-off-by: J. Bruce Fields Signed-off-by: Neil Brown ### Diffstat output ./fs/nfsd/export.c | 4 ++++ 1 file changed, 4 insertions(+) diff .prev/fs/nfsd/export.c ./fs/nfsd/export.c --- .prev/fs/nfsd/export.c 2006-12-08 12:07:28.000000000 +1100 +++ ./fs/nfsd/export.c 2006-12-08 12:08:20.000000000 +1100 @@ -1104,6 +1104,10 @@ exp_rootfh(svc_client *clp, char *path, path, nd.dentry, clp->name, inode->i_sb->s_id, inode->i_ino); exp = exp_parent(clp, nd.mnt, nd.dentry, NULL); + if (IS_ERR(exp)) { + err = PTR_ERR(exp); + goto out; + } if (!exp) { dprintk("nfsd: exp_rootfh export not found.\n"); goto out; ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164335AbWLHBNc (ORCPT ); Thu, 7 Dec 2006 20:13:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1164242AbWLHBNc (ORCPT ); Thu, 7 Dec 2006 20:13:32 -0500 Received: from ns2.suse.de ([195.135.220.15]:47155 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164335AbWLHBN3 (ORCPT ); Thu, 7 Dec 2006 20:13:29 -0500 From: NeilBrown To: Andrew Morton Date: Fri, 8 Dec 2006 12:13:41 +1100 Message-Id: <1061208011341.30603@suse.de> X-face: [Gw_3E*Gng}4rRrKRYotwlE?.2|**#s9D Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: J.Bruce Fields Since exp_parent can fail by returning an error (-EAGAIN) in addition to by returning NULL, we should check for that case in exp_rootfh. (TODO: we should check that userland handles these errors too.) Signed-off-by: J. Bruce Fields Signed-off-by: Neil Brown ### Diffstat output ./fs/nfsd/export.c | 4 ++++ 1 file changed, 4 insertions(+) diff .prev/fs/nfsd/export.c ./fs/nfsd/export.c --- .prev/fs/nfsd/export.c 2006-12-08 12:07:28.000000000 +1100 +++ ./fs/nfsd/export.c 2006-12-08 12:08:20.000000000 +1100 @@ -1104,6 +1104,10 @@ exp_rootfh(svc_client *clp, char *path, path, nd.dentry, clp->name, inode->i_sb->s_id, inode->i_ino); exp = exp_parent(clp, nd.mnt, nd.dentry, NULL); + if (IS_ERR(exp)) { + err = PTR_ERR(exp); + goto out; + } if (!exp) { dprintk("nfsd: exp_rootfh export not found.\n"); goto out;