From patchwork Thu Feb 10 12:21:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaliy Gusev X-Patchwork-Id: 546061 X-Patchwork-Delegate: Trond.Myklebust@netapp.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1ACLIL3009963 for ; Thu, 10 Feb 2011 12:21:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751147Ab1BJMVR (ORCPT ); Thu, 10 Feb 2011 07:21:17 -0500 Received: from relay03.bluemeaney.com ([205.234.16.187]:56235 "EHLO relay03.bluemeaney.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895Ab1BJMVQ convert rfc822-to-8bit (ORCPT ); Thu, 10 Feb 2011 07:21:16 -0500 X-ASG-Debug-ID: 1297340475-6eb6889b0001-suBQlS Received: from sfdc-fe01.bluemeaney.com ([172.28.16.33]) by relay03.bluemeaney.com with ESMTP id QFcFwiyw81Uwq10s; Thu, 10 Feb 2011 04:21:15 -0800 (PST) X-Barracuda-Envelope-From: Gusev.Vitaliy@nexenta.com X-ASG-Whitelist: Client Received: from exch-ang.bluemeaney.com ([172.28.16.71]) by sfdc-fe01.bluemeaney.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 10 Feb 2011 04:21:15 -0800 Received: from 172.28.16.12 ([172.28.16.12]) by exch-ang.bluemeaney.com ([172.28.16.71]) via Exchange Front-End Server owa.bluemeaney.com ([172.28.16.34]) with Microsoft Exchange Server HTTP-DAV ; Thu, 10 Feb 2011 12:21:14 +0000 X-Barracuda-BBL-IP: 172.28.16.71 X-Barracuda-RBL-IP: 172.28.16.71 Received: from vT510 by owa.bluemeaney.com; 10 Feb 2011 15:21:14 +0300 Subject: [PATCH 2/2] nfsv4: Fix dereference i_op->lookup and call NULL pointer at d_alloc_and_lookup() From: Vitaliy Gusev X-ASG-Orig-Subj: [PATCH 2/2] nfsv4: Fix dereference i_op->lookup and call NULL pointer at d_alloc_and_lookup() To: Trond Myklebust Cc: Al Viro , linux-fsdevel , David Howells , linux-nfs@vger.kernel.org In-Reply-To: <1297338894.3667.0.camel@vT510> References: <1297338894.3667.0.camel@vT510> Date: Thu, 10 Feb 2011 15:21:14 +0300 Message-ID: <1297340474.3667.13.camel@vT510> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 X-OriginalArrivalTime: 10 Feb 2011 12:21:15.0637 (UTC) FILETIME=[03466250:01CBC91D] X-Barracuda-Connect: UNKNOWN[172.28.16.33] X-Barracuda-Start-Time: 1297340475 X-Barracuda-URL: http://spam.bluemeaney.com:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at bluemeaney.com Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 10 Feb 2011 12:21:18 +0000 (UTC) diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c index b5ffe8f..7979652 100644 --- a/fs/nfs/getroot.c +++ b/fs/nfs/getroot.c @@ -199,6 +199,10 @@ struct dentry *nfs4_get_root(struct super_block *sb, struct nfs_fh *mntfh) goto out; } + if (fattr->valid & NFS_ATTR_FATTR_FSID && + !nfs_fsid_equal(&server->fsid, &fattr->fsid)) + memcpy(&server->fsid, &fattr->fsid, sizeof(server->fsid)); + inode = nfs_fhget(sb, mntfh, fattr); if (IS_ERR(inode)) {