diff options
-rw-r--r-- | fs/nfs/nfs4client.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 2e9779b58b7a..47d100872390 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
@@ -29,15 +29,14 @@ static int nfs_get_cb_ident_idr(struct nfs_client *clp, int minorversion) | |||
29 | 29 | ||
30 | if (clp->rpc_ops->version != 4 || minorversion != 0) | 30 | if (clp->rpc_ops->version != 4 || minorversion != 0) |
31 | return ret; | 31 | return ret; |
32 | retry: | 32 | idr_preload(GFP_KERNEL); |
33 | if (!idr_pre_get(&nn->cb_ident_idr, GFP_KERNEL)) | ||
34 | return -ENOMEM; | ||
35 | spin_lock(&nn->nfs_client_lock); | 33 | spin_lock(&nn->nfs_client_lock); |
36 | ret = idr_get_new(&nn->cb_ident_idr, clp, &clp->cl_cb_ident); | 34 | ret = idr_alloc(&nn->cb_ident_idr, clp, 0, 0, GFP_NOWAIT); |
35 | if (ret >= 0) | ||
36 | clp->cl_cb_ident = ret; | ||
37 | spin_unlock(&nn->nfs_client_lock); | 37 | spin_unlock(&nn->nfs_client_lock); |
38 | if (ret == -EAGAIN) | 38 | idr_preload_end(); |
39 | goto retry; | 39 | return ret < 0 ? ret : 0; |
40 | return ret; | ||
41 | } | 40 | } |
42 | 41 | ||
43 | #ifdef CONFIG_NFS_V4_1 | 42 | #ifdef CONFIG_NFS_V4_1 |