Commit c89be524 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 3664ce2d 1b720406
...@@ -572,7 +572,7 @@ __be32 nfs4_callback_sequence(void *argp, void *resp, ...@@ -572,7 +572,7 @@ __be32 nfs4_callback_sequence(void *argp, void *resp,
} }
static bool static bool
validate_bitmap_values(unsigned long mask) validate_bitmap_values(unsigned int mask)
{ {
return (mask & ~RCA4_TYPE_MASK_ALL) == 0; return (mask & ~RCA4_TYPE_MASK_ALL) == 0;
} }
...@@ -596,17 +596,15 @@ __be32 nfs4_callback_recallany(void *argp, void *resp, ...@@ -596,17 +596,15 @@ __be32 nfs4_callback_recallany(void *argp, void *resp,
goto out; goto out;
status = cpu_to_be32(NFS4_OK); status = cpu_to_be32(NFS4_OK);
if (test_bit(RCA4_TYPE_MASK_RDATA_DLG, (const unsigned long *) if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_RDATA_DLG))
&args->craa_type_mask))
flags = FMODE_READ; flags = FMODE_READ;
if (test_bit(RCA4_TYPE_MASK_WDATA_DLG, (const unsigned long *) if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_WDATA_DLG))
&args->craa_type_mask))
flags |= FMODE_WRITE; flags |= FMODE_WRITE;
if (test_bit(RCA4_TYPE_MASK_FILE_LAYOUT, (const unsigned long *)
&args->craa_type_mask))
pnfs_recall_all_layouts(cps->clp);
if (flags) if (flags)
nfs_expire_unused_delegation_types(cps->clp, flags); nfs_expire_unused_delegation_types(cps->clp, flags);
if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_FILE_LAYOUT))
pnfs_recall_all_layouts(cps->clp);
out: out:
dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
return status; return status;
......
...@@ -873,7 +873,7 @@ static void nfs3_nlm_release_call(void *data) ...@@ -873,7 +873,7 @@ static void nfs3_nlm_release_call(void *data)
} }
} }
const struct nlmclnt_operations nlmclnt_fl_close_lock_ops = { static const struct nlmclnt_operations nlmclnt_fl_close_lock_ops = {
.nlmclnt_alloc_call = nfs3_nlm_alloc_call, .nlmclnt_alloc_call = nfs3_nlm_alloc_call,
.nlmclnt_unlock_prepare = nfs3_nlm_unlock_prepare, .nlmclnt_unlock_prepare = nfs3_nlm_unlock_prepare,
.nlmclnt_release_call = nfs3_nlm_release_call, .nlmclnt_release_call = nfs3_nlm_release_call,
......
...@@ -868,8 +868,10 @@ static int nfs4_set_client(struct nfs_server *server, ...@@ -868,8 +868,10 @@ static int nfs4_set_client(struct nfs_server *server,
if (IS_ERR(clp)) if (IS_ERR(clp))
return PTR_ERR(clp); return PTR_ERR(clp);
if (server->nfs_client == clp) if (server->nfs_client == clp) {
nfs_put_client(clp);
return -ELOOP; return -ELOOP;
}
/* /*
* Query for the lease time on clientid setup or renewal * 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,11 +1246,11 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname,
clp->cl_proto, clnt->cl_timeout, clp->cl_proto, clnt->cl_timeout,
clp->cl_minorversion, net); clp->cl_minorversion, net);
clear_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status); clear_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status);
nfs_put_client(clp);
if (error != 0) { if (error != 0) {
nfs_server_insert_lists(server); nfs_server_insert_lists(server);
return error; return error;
} }
nfs_put_client(clp);
if (server->nfs_client->cl_hostname == NULL) if (server->nfs_client->cl_hostname == NULL)
server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL); server->nfs_client->cl_hostname = kstrdup(hostname, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment