NFS: Fix access to suid/sgid executables
[platform/adaptation/renesas_rcar/renesas_kernel.git] / fs / nfs / client.c
index 8b39a42..9f3c664 100644 (file)
@@ -277,7 +277,7 @@ void nfs_put_client(struct nfs_client *clp)
                nfs_cb_idr_remove_locked(clp);
                spin_unlock(&nn->nfs_client_lock);
 
-               BUG_ON(!list_empty(&clp->cl_superblocks));
+               WARN_ON_ONCE(!list_empty(&clp->cl_superblocks));
 
                clp->rpc_ops->free_client(clp);
        }
@@ -615,8 +615,7 @@ EXPORT_SYMBOL_GPL(nfs_create_rpc_client);
  */
 static void nfs_destroy_server(struct nfs_server *server)
 {
-       if (!(server->flags & NFS_MOUNT_LOCAL_FLOCK) ||
-                       !(server->flags & NFS_MOUNT_LOCAL_FCNTL))
+       if (server->nlm_host)
                nlmclnt_done(server->nlm_host);
 }
 
@@ -1061,10 +1060,6 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info,
        if (error < 0)
                goto error;
 
-       BUG_ON(!server->nfs_client);
-       BUG_ON(!server->nfs_client->rpc_ops);
-       BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops);
-
        /* Probe the root fh to retrieve its FSID */
        error = nfs_probe_fsinfo(server, mount_info->mntfh, fattr);
        if (error < 0)