diff options
Diffstat (limited to 'fs/nfs/callback.c')
-rw-r--r-- | fs/nfs/callback.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index c0b05497972b..15677e7bede5 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -16,9 +16,7 @@ | |||
16 | #include <linux/freezer.h> | 16 | #include <linux/freezer.h> |
17 | #include <linux/kthread.h> | 17 | #include <linux/kthread.h> |
18 | #include <linux/sunrpc/svcauth_gss.h> | 18 | #include <linux/sunrpc/svcauth_gss.h> |
19 | #if defined(CONFIG_NFS_V4_1) | ||
20 | #include <linux/sunrpc/bc_xprt.h> | 19 | #include <linux/sunrpc/bc_xprt.h> |
21 | #endif | ||
22 | 20 | ||
23 | #include <net/inet_sock.h> | 21 | #include <net/inet_sock.h> |
24 | 22 | ||
@@ -384,6 +382,23 @@ static int check_gss_callback_principal(struct nfs_client *clp, | |||
384 | return SVC_OK; | 382 | return SVC_OK; |
385 | } | 383 | } |
386 | 384 | ||
385 | /* pg_authenticate method helper */ | ||
386 | static struct nfs_client *nfs_cb_find_client(struct svc_rqst *rqstp) | ||
387 | { | ||
388 | struct nfs4_sessionid *sessionid = bc_xprt_sid(rqstp); | ||
389 | int is_cb_compound = rqstp->rq_proc == CB_COMPOUND ? 1 : 0; | ||
390 | |||
391 | dprintk("--> %s rq_proc %d\n", __func__, rqstp->rq_proc); | ||
392 | if (svc_is_backchannel(rqstp)) | ||
393 | /* Sessionid (usually) set after CB_NULL ping */ | ||
394 | return nfs4_find_client_sessionid(svc_addr(rqstp), sessionid, | ||
395 | is_cb_compound); | ||
396 | else | ||
397 | /* No callback identifier in pg_authenticate */ | ||
398 | return nfs4_find_client_no_ident(svc_addr(rqstp)); | ||
399 | } | ||
400 | |||
401 | /* pg_authenticate method for nfsv4 callback threads. */ | ||
387 | static int nfs_callback_authenticate(struct svc_rqst *rqstp) | 402 | static int nfs_callback_authenticate(struct svc_rqst *rqstp) |
388 | { | 403 | { |
389 | struct nfs_client *clp; | 404 | struct nfs_client *clp; |
@@ -391,7 +406,7 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp) | |||
391 | int ret = SVC_OK; | 406 | int ret = SVC_OK; |
392 | 407 | ||
393 | /* Don't talk to strangers */ | 408 | /* Don't talk to strangers */ |
394 | clp = nfs_find_client(svc_addr(rqstp), 4); | 409 | clp = nfs_cb_find_client(rqstp); |
395 | if (clp == NULL) | 410 | if (clp == NULL) |
396 | return SVC_DROP; | 411 | return SVC_DROP; |
397 | 412 | ||