From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trond Myklebust Subject: Re: [PATCH] nfs4: Fix NULL dereference at d_alloc_and_lookup() Date: Tue, 22 Mar 2011 17:52:22 -0400 Message-ID: <1300830742.9442.53.camel@lade.trondhjem.org> References: <1300830025-17152-1-git-send-email-gusev.vitaliy@nexenta.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Al Viro , linux-fsdevel To: Vitaliy Gusev Return-path: In-Reply-To: <1300830025-17152-1-git-send-email-gusev.vitaliy-x4E8uuA0+mFBDgjK7y7TUQ@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On Wed, 2011-03-23 at 00:40 +0300, Vitaliy Gusev wrote: > From: Gusev Vitaliy > > d_alloc_and_lookup() calls i_op->lookup method due to > rootfh changes his fsid. > > During mount i_op of NFS root inode is set to > nfs_mountpoint_inode_operations, if rpc_ops->getroot() > and rpc_ops->getattr() return different fsid. That is a server bug! Why are you trying to "fix" that on the client instead of telling the user that their server deserves to be burned behind the shed? > > + if (fattr->valid & NFS_ATTR_FATTR_FSID && > + !nfs_fsid_equal(&server->fsid, &fattr->fsid)) > + memcpy(&server->fsid, &fattr->fsid, sizeof(server->fsid)); No. add a printk() to the effect that the server is insane, return -EIO and we're done... -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org www.netapp.com -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html