Commit ce008c4b authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Fix nfs4_callback_recallslot to work with dynamic slot allocation

Ensure that the NFSv4.1 CB_RECALL_SLOT callback updates the slot table
target max slotid safely.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent da0507b7
...@@ -576,7 +576,7 @@ __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, void *dummy, ...@@ -576,7 +576,7 @@ __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, void *dummy,
if (args->crsa_target_max_slots == fc_tbl->max_slots) if (args->crsa_target_max_slots == fc_tbl->max_slots)
goto out; goto out;
fc_tbl->target_highest_slotid = args->crsa_target_max_slots; nfs41_set_target_slotid(fc_tbl, args->crsa_target_max_slots);
nfs41_handle_recall_slot(cps->clp); nfs41_handle_recall_slot(cps->clp);
out: out:
dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
......
...@@ -260,6 +260,8 @@ extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, ...@@ -260,6 +260,8 @@ extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data,
extern struct nfs4_slot *nfs4_alloc_slots(struct nfs4_slot_table *table, extern struct nfs4_slot *nfs4_alloc_slots(struct nfs4_slot_table *table,
u32 max_slots, gfp_t gfp_flags); u32 max_slots, gfp_t gfp_flags);
extern void nfs41_set_target_slotid(struct nfs4_slot_table *tbl,
u32 target_highest_slotid);
static inline bool static inline bool
is_ds_only_client(struct nfs_client *clp) is_ds_only_client(struct nfs_client *clp)
......
...@@ -498,6 +498,14 @@ static void nfs41_set_target_slotid_locked(struct nfs4_slot_table *tbl, ...@@ -498,6 +498,14 @@ static void nfs41_set_target_slotid_locked(struct nfs4_slot_table *tbl,
tbl->generation++; tbl->generation++;
} }
void nfs41_set_target_slotid(struct nfs4_slot_table *tbl,
u32 target_highest_slotid)
{
spin_lock(&tbl->slot_tbl_lock);
nfs41_set_target_slotid_locked(tbl, target_highest_slotid);
spin_unlock(&tbl->slot_tbl_lock);
}
static void nfs41_set_server_slotid_locked(struct nfs4_slot_table *tbl, static void nfs41_set_server_slotid_locked(struct nfs4_slot_table *tbl,
u32 highest_slotid) u32 highest_slotid)
{ {
......
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