aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2011-08-02 14:46:29 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-29 13:29:08 -0700
commitf4bc412bc2f46d644375403b601f42d8487949da (patch)
tree29dd599a646a6d11a16109ae566e971549cbed7b /fs/nfs/callback.h
parentb861a2580da034f6a57517c687ded68e20f99763 (diff)
downloadkernel_samsung_smdk4412-f4bc412bc2f46d644375403b601f42d8487949da.zip
kernel_samsung_smdk4412-f4bc412bc2f46d644375403b601f42d8487949da.tar.gz
kernel_samsung_smdk4412-f4bc412bc2f46d644375403b601f42d8487949da.tar.bz2
NFSv4.1: Fix the callback 'highest_used_slotid' behaviour
commit 55a673990ec04cf63005318bcf08c2b0046e5778 upstream. Currently, there is no guarantee that we will call nfs4_cb_take_slot() even though nfs4_callback_compound() will consistently call nfs4_cb_free_slot() provided the cb_process_state has set the 'clp' field. The result is that we can trigger the BUG_ON() upon the next call to nfs4_cb_take_slot(). This patch fixes the above problem by using the slot id that was taken in the CB_SEQUENCE operation as a flag for whether or not we need to call nfs4_cb_free_slot(). It also fixes an atomicity problem: we need to set tbl->highest_used_slotid atomically with the check for NFS4_SESSION_DRAINING, otherwise we end up racing with the various tests in nfs4_begin_drain_session(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/nfs/callback.h')
-rw-r--r--fs/nfs/callback.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h
index b257383..07df5f1 100644
--- a/fs/nfs/callback.h
+++ b/fs/nfs/callback.h
@@ -38,6 +38,7 @@ enum nfs4_callback_opnum {
struct cb_process_state {
__be32 drc_status;
struct nfs_client *clp;
+ int slotid;
};
struct cb_compound_hdr_arg {
@@ -166,7 +167,6 @@ extern unsigned nfs4_callback_layoutrecall(
void *dummy, struct cb_process_state *cps);
extern void nfs4_check_drain_bc_complete(struct nfs4_session *ses);
-extern void nfs4_cb_take_slot(struct nfs_client *clp);
struct cb_devicenotifyitem {
uint32_t cbd_notify_type;