summaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-08-23 02:06:14 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-23 05:24:38 +0200
commit9c5bf38d85a31b946664bcc21078ef5bb10672f7 (patch)
treecceee456ebefe2380a417746b366d67a11ec6ebe /fs/nfs/client.c
parentNFS: Ensure NFSv2/v3 mounts respect the NFS_MOUNT_SECFLAVOUR flag (diff)
downloadlinux-9c5bf38d85a31b946664bcc21078ef5bb10672f7.tar.xz
linux-9c5bf38d85a31b946664bcc21078ef5bb10672f7.zip
NFS: Fix nfs_alloc_client()
The scheme to indicate which services have been started up appears to be seriously broken. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 700bd5801223..471d975e63c3 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -113,9 +113,9 @@ static struct nfs_client *nfs_alloc_client(const char *hostname,
if (error < 0) {
dprintk("%s: couldn't start rpciod! Error = %d\n",
__FUNCTION__, error);
- __set_bit(NFS_CS_RPCIOD, &clp->cl_res_state);
goto error_1;
}
+ __set_bit(NFS_CS_RPCIOD, &clp->cl_res_state);
if (nfsversion == 4) {
if (nfs_callback_up() < 0)
@@ -153,8 +153,8 @@ static struct nfs_client *nfs_alloc_client(const char *hostname,
return clp;
error_3:
- nfs_callback_down();
- __clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state);
+ if (__test_and_clear_bit(NFS_CS_CALLBACK, &clp->cl_res_state))
+ nfs_callback_down();
error_2:
rpciod_down();
__clear_bit(NFS_CS_RPCIOD, &clp->cl_res_state);
@@ -195,7 +195,7 @@ static void nfs_free_client(struct nfs_client *clp)
nfs_callback_down();
if (__test_and_clear_bit(NFS_CS_RPCIOD, &clp->cl_res_state))
- rpciod_down();
+ rpciod_down();
kfree(clp->cl_hostname);
kfree(clp);
@@ -881,9 +881,9 @@ static int nfs4_init_client(struct nfs_client *clp,
if (error < 0) {
dprintk("%s: failed to create idmapper. Error = %d\n",
__FUNCTION__, error);
- __set_bit(NFS_CS_IDMAP, &clp->cl_res_state);
goto error;
}
+ __set_bit(NFS_CS_IDMAP, &clp->cl_res_state);
nfs_mark_client_ready(clp, NFS_CS_READY);
return 0;