aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-25 16:43:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-25 16:43:18 -0500
commitc89be5242607d8aa08a6fa45a887c68b2d4a2a2c (patch)
treeffb4f4aafe50580b84f80e1390d51e4074f95bca
parent3664ce2d930983966d2aac0e167f1332988c4e25 (diff)
parent1b7204064582792b77c6be796e78bd821c9f71b1 (diff)
Merge tag 'nfs-for-4.16-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client bugfixes from Trond Myklebust: - fix a broken cast in nfs4_callback_recallany() - fix an Oops during NFSv4 migration events - make struct nlmclnt_fl_close_lock_ops static * tag 'nfs-for-4.16-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: NFS: make struct nlmclnt_fl_close_lock_ops static nfs: system crashes after NFS4ERR_MOVED recovery NFSv4: Fix broken cast in nfs4_callback_recallany()
-rw-r--r--fs/nfs/callback_proc.c14
-rw-r--r--fs/nfs/nfs3proc.c2
-rw-r--r--fs/nfs/nfs4client.c6
3 files changed, 11 insertions, 11 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 2435af56b87e..a50d7813e3ea 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -572,7 +572,7 @@ out:
572} 572}
573 573
574static bool 574static bool
575validate_bitmap_values(unsigned long mask) 575validate_bitmap_values(unsigned int mask)
576{ 576{
577 return (mask & ~RCA4_TYPE_MASK_ALL) == 0; 577 return (mask & ~RCA4_TYPE_MASK_ALL) == 0;
578} 578}
@@ -596,17 +596,15 @@ __be32 nfs4_callback_recallany(void *argp, void *resp,
596 goto out; 596 goto out;
597 597
598 status = cpu_to_be32(NFS4_OK); 598 status = cpu_to_be32(NFS4_OK);
599 if (test_bit(RCA4_TYPE_MASK_RDATA_DLG, (const unsigned long *) 599 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_RDATA_DLG))
600 &args->craa_type_mask))
601 flags = FMODE_READ; 600 flags = FMODE_READ;
602 if (test_bit(RCA4_TYPE_MASK_WDATA_DLG, (const unsigned long *) 601 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_WDATA_DLG))
603 &args->craa_type_mask))
604 flags |= FMODE_WRITE; 602 flags |= FMODE_WRITE;
605 if (test_bit(RCA4_TYPE_MASK_FILE_LAYOUT, (const unsigned long *)
606 &args->craa_type_mask))
607 pnfs_recall_all_layouts(cps->clp);
608 if (flags) 603 if (flags)
609 nfs_expire_unused_delegation_types(cps->clp, flags); 604 nfs_expire_unused_delegation_types(cps->clp, flags);
605
606 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_FILE_LAYOUT))
607 pnfs_recall_all_layouts(cps->clp);
610out: 608out:
611 dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); 609 dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
612 return status; 610 return status;
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 49f848fd1f04..7327930ad970 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -873,7 +873,7 @@ static void nfs3_nlm_release_call(void *data)
873 } 873 }
874} 874}
875 875
876const struct nlmclnt_operations nlmclnt_fl_close_lock_ops = { 876static const struct nlmclnt_operations nlmclnt_fl_close_lock_ops = {
877 .nlmclnt_alloc_call = nfs3_nlm_alloc_call, 877 .nlmclnt_alloc_call = nfs3_nlm_alloc_call,
878 .nlmclnt_unlock_prepare = nfs3_nlm_unlock_prepare, 878 .nlmclnt_unlock_prepare = nfs3_nlm_unlock_prepare,
879 .nlmclnt_release_call = nfs3_nlm_release_call, 879 .nlmclnt_release_call = nfs3_nlm_release_call,
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 04612c24d394..979631411a0e 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -868,8 +868,10 @@ static int nfs4_set_client(struct nfs_server *server,
868 if (IS_ERR(clp)) 868 if (IS_ERR(clp))
869 return PTR_ERR(clp); 869 return PTR_ERR(clp);
870 870
871 if (server->nfs_client == clp) 871 if (server->nfs_client == clp) {
872 nfs_put_client(clp);
872 return -ELOOP; 873 return -ELOOP;
874 }
873 875
874 /* 876 /*
875 * Query for the lease time on clientid setup or renewal 877 * Query for the lease time on clientid setup or renewal
@@ -1244,11 +1246,11 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname,
1244 clp->cl_proto, clnt->cl_timeout, 1246 clp->cl_proto, clnt->cl_timeout,
1245 clp->cl_minorversion, net); 1247 clp->cl_minorversion, net);
1246 clear_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status); 1248 clear_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status);
1247 nfs_put_client(clp);
1248 if (error != 0) { 1249 if (error != 0) {
1249 nfs_server_insert_lists(server); 1250 nfs_server_insert_lists(server);
1250 return error; 1251 return error;
1251 } 1252 }
1253 nfs_put_client(clp);
1252 1254
1253 if (server->nfs_client->cl_hostname == NULL) 1255 if (server->nfs_client->cl_hostname == NULL)
1254 server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL); 1256 server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL);