]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfs/namespace.c
ide: Add tx4939ide driver (v6)
[linux-2.6-omap-h63xx.git] / fs / nfs / namespace.c
index 2f285ef76399f227283146fc15d05a30508f6dbd..64a288ee046d027692f1dc395792609cfe1760aa 100644 (file)
@@ -105,7 +105,10 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
 
        dprintk("--> nfs_follow_mountpoint()\n");
 
-       BUG_ON(IS_ROOT(dentry));
+       err = -ESTALE;
+       if (IS_ROOT(dentry))
+               goto out_err;
+
        dprintk("%s: enter\n", __func__);
        dput(nd->path.dentry);
        nd->path.dentry = dget(dentry);
@@ -129,7 +132,7 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
                goto out_err;
 
        mntget(mnt);
-       err = do_add_mount(mnt, nd, nd->path.mnt->mnt_flags|MNT_SHRINKABLE,
+       err = do_add_mount(mnt, &nd->path, nd->path.mnt->mnt_flags|MNT_SHRINKABLE,
                           &nfs_automount_list);
        if (err < 0) {
                mntput(mnt);
@@ -189,7 +192,7 @@ static struct vfsmount *nfs_do_clone_mount(struct nfs_server *server,
                                           struct nfs_clone_mount *mountdata)
 {
 #ifdef CONFIG_NFS_V4
-       struct vfsmount *mnt = NULL;
+       struct vfsmount *mnt = ERR_PTR(-EINVAL);
        switch (server->nfs_client->rpc_ops->version) {
                case 2:
                case 3: