summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2019-04-07 13:58:44 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2019-04-25 14:18:12 -0400
commitae67bd3821bb0a54d97e7883d211196637d487a9 (patch)
tree351a54fd10a71f6c76d5e8d8a8ce323c9252192e /fs
parent085b7755808aa11f78ab9377257e1dad2e6fa4bb (diff)
SUNRPC: Fix up task signalling
The RPC_TASK_KILLED flag should really not be set from another context because it can clobber data in the struct task when task->tk_flags is changed non-atomically. Let's therefore swap out RPC_TASK_KILLED with an atomic flag, and add a function to set that flag and safely wake up the task. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/lockd/clntproc.c4
-rw-r--r--fs/nfsd/nfs4callback.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index e8a004097d18..d9c32d1a20c0 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -715,7 +715,7 @@ static void nlmclnt_unlock_callback(struct rpc_task *task, void *data)
715 struct nlm_rqst *req = data; 715 struct nlm_rqst *req = data;
716 u32 status = ntohl(req->a_res.status); 716 u32 status = ntohl(req->a_res.status);
717 717
718 if (RPC_ASSASSINATED(task)) 718 if (RPC_SIGNALLED(task))
719 goto die; 719 goto die;
720 720
721 if (task->tk_status < 0) { 721 if (task->tk_status < 0) {
@@ -783,7 +783,7 @@ static void nlmclnt_cancel_callback(struct rpc_task *task, void *data)
783 struct nlm_rqst *req = data; 783 struct nlm_rqst *req = data;
784 u32 status = ntohl(req->a_res.status); 784 u32 status = ntohl(req->a_res.status);
785 785
786 if (RPC_ASSASSINATED(task)) 786 if (RPC_SIGNALLED(task))
787 goto die; 787 goto die;
788 788
789 if (task->tk_status < 0) { 789 if (task->tk_status < 0) {
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index d219159b98af..f7494be8dbe2 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -1032,7 +1032,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback
1032 * the submission code will error out, so we don't need to 1032 * the submission code will error out, so we don't need to
1033 * handle that case here. 1033 * handle that case here.
1034 */ 1034 */
1035 if (task->tk_flags & RPC_TASK_KILLED) 1035 if (RPC_SIGNALLED(task))
1036 goto need_restart; 1036 goto need_restart;
1037 1037
1038 return true; 1038 return true;
@@ -1081,7 +1081,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback
1081 dprintk("%s: freed slot, new seqid=%d\n", __func__, 1081 dprintk("%s: freed slot, new seqid=%d\n", __func__,
1082 clp->cl_cb_session->se_cb_seq_nr); 1082 clp->cl_cb_session->se_cb_seq_nr);
1083 1083
1084 if (task->tk_flags & RPC_TASK_KILLED) 1084 if (RPC_SIGNALLED(task))
1085 goto need_restart; 1085 goto need_restart;
1086out: 1086out:
1087 return ret; 1087 return ret;