aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-02-19 20:04:23 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-02-26 00:40:37 -0500
commit101070ca2fe67186f5f5517b66cb4757b17f4e29 (patch)
treeb131c97e3033fc4c848e8cb3d76f675735b95085 /fs
parent5746006f1d17d9d5a3015051ea54de4341cb31f9 (diff)
NFS: Ensure that the asynchronous RPC calls complete on nfsiod.
We want to ensure that rpc_call_ops that involve mntput() are run on nfsiod rather than on rpciod, so that they don't deadlock when the resulting umount calls rpc_shutdown_client(). Hence we specify that read, write and commit calls must complete on nfsiod. Ditto for NFSv4 open, lock, locku and close asynchronous calls. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/direct.c4
-rw-r--r--fs/nfs/nfs4proc.c6
-rw-r--r--fs/nfs/read.c1
-rw-r--r--fs/nfs/write.c2
4 files changed, 13 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index e0170407a885..e44200579c8d 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -280,6 +280,7 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_direct_req *dreq,
280 .rpc_client = NFS_CLIENT(inode), 280 .rpc_client = NFS_CLIENT(inode),
281 .rpc_message = &msg, 281 .rpc_message = &msg,
282 .callback_ops = &nfs_read_direct_ops, 282 .callback_ops = &nfs_read_direct_ops,
283 .workqueue = nfsiod_workqueue,
283 .flags = RPC_TASK_ASYNC, 284 .flags = RPC_TASK_ASYNC,
284 }; 285 };
285 unsigned int pgbase; 286 unsigned int pgbase;
@@ -446,6 +447,7 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq)
446 struct rpc_task_setup task_setup_data = { 447 struct rpc_task_setup task_setup_data = {
447 .rpc_client = NFS_CLIENT(inode), 448 .rpc_client = NFS_CLIENT(inode),
448 .callback_ops = &nfs_write_direct_ops, 449 .callback_ops = &nfs_write_direct_ops,
450 .workqueue = nfsiod_workqueue,
449 .flags = RPC_TASK_ASYNC, 451 .flags = RPC_TASK_ASYNC,
450 }; 452 };
451 453
@@ -537,6 +539,7 @@ static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq)
537 .rpc_message = &msg, 539 .rpc_message = &msg,
538 .callback_ops = &nfs_commit_direct_ops, 540 .callback_ops = &nfs_commit_direct_ops,
539 .callback_data = data, 541 .callback_data = data,
542 .workqueue = nfsiod_workqueue,
540 .flags = RPC_TASK_ASYNC, 543 .flags = RPC_TASK_ASYNC,
541 }; 544 };
542 545
@@ -683,6 +686,7 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq,
683 .rpc_client = NFS_CLIENT(inode), 686 .rpc_client = NFS_CLIENT(inode),
684 .rpc_message = &msg, 687 .rpc_message = &msg,
685 .callback_ops = &nfs_write_direct_ops, 688 .callback_ops = &nfs_write_direct_ops,
689 .workqueue = nfsiod_workqueue,
686 .flags = RPC_TASK_ASYNC, 690 .flags = RPC_TASK_ASYNC,
687 }; 691 };
688 size_t wsize = NFS_SERVER(inode)->wsize; 692 size_t wsize = NFS_SERVER(inode)->wsize;
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 7ce07862c2fb..b6db833f33e6 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -51,6 +51,7 @@
51 51
52#include "nfs4_fs.h" 52#include "nfs4_fs.h"
53#include "delegation.h" 53#include "delegation.h"
54#include "internal.h"
54#include "iostat.h" 55#include "iostat.h"
55 56
56#define NFSDBG_FACILITY NFSDBG_PROC 57#define NFSDBG_FACILITY NFSDBG_PROC
@@ -773,6 +774,7 @@ static int _nfs4_proc_open_confirm(struct nfs4_opendata *data)
773 .rpc_message = &msg, 774 .rpc_message = &msg,
774 .callback_ops = &nfs4_open_confirm_ops, 775 .callback_ops = &nfs4_open_confirm_ops,
775 .callback_data = data, 776 .callback_data = data,
777 .workqueue = nfsiod_workqueue,
776 .flags = RPC_TASK_ASYNC, 778 .flags = RPC_TASK_ASYNC,
777 }; 779 };
778 int status; 780 int status;
@@ -910,6 +912,7 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
910 .rpc_message = &msg, 912 .rpc_message = &msg,
911 .callback_ops = &nfs4_open_ops, 913 .callback_ops = &nfs4_open_ops,
912 .callback_data = data, 914 .callback_data = data,
915 .workqueue = nfsiod_workqueue,
913 .flags = RPC_TASK_ASYNC, 916 .flags = RPC_TASK_ASYNC,
914 }; 917 };
915 int status; 918 int status;
@@ -1315,6 +1318,7 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, int wait)
1315 .rpc_client = server->client, 1318 .rpc_client = server->client,
1316 .rpc_message = &msg, 1319 .rpc_message = &msg,
1317 .callback_ops = &nfs4_close_ops, 1320 .callback_ops = &nfs4_close_ops,
1321 .workqueue = nfsiod_workqueue,
1318 .flags = RPC_TASK_ASYNC, 1322 .flags = RPC_TASK_ASYNC,
1319 }; 1323 };
1320 int status = -ENOMEM; 1324 int status = -ENOMEM;
@@ -3235,6 +3239,7 @@ static struct rpc_task *nfs4_do_unlck(struct file_lock *fl,
3235 .rpc_client = NFS_CLIENT(lsp->ls_state->inode), 3239 .rpc_client = NFS_CLIENT(lsp->ls_state->inode),
3236 .rpc_message = &msg, 3240 .rpc_message = &msg,
3237 .callback_ops = &nfs4_locku_ops, 3241 .callback_ops = &nfs4_locku_ops,
3242 .workqueue = nfsiod_workqueue,
3238 .flags = RPC_TASK_ASYNC, 3243 .flags = RPC_TASK_ASYNC,
3239 }; 3244 };
3240 3245
@@ -3419,6 +3424,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
3419 .rpc_client = NFS_CLIENT(state->inode), 3424 .rpc_client = NFS_CLIENT(state->inode),
3420 .rpc_message = &msg, 3425 .rpc_message = &msg,
3421 .callback_ops = &nfs4_lock_ops, 3426 .callback_ops = &nfs4_lock_ops,
3427 .workqueue = nfsiod_workqueue,
3422 .flags = RPC_TASK_ASYNC, 3428 .flags = RPC_TASK_ASYNC,
3423 }; 3429 };
3424 int ret; 3430 int ret;
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index fab0d3720a03..87546cd277d5 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -177,6 +177,7 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
177 .rpc_message = &msg, 177 .rpc_message = &msg,
178 .callback_ops = call_ops, 178 .callback_ops = call_ops,
179 .callback_data = data, 179 .callback_data = data,
180 .workqueue = nfsiod_workqueue,
180 .flags = RPC_TASK_ASYNC | swap_flags, 181 .flags = RPC_TASK_ASYNC | swap_flags,
181 }; 182 };
182 183
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 69b4158d9a10..84495ef90728 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -803,6 +803,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
803 .rpc_message = &msg, 803 .rpc_message = &msg,
804 .callback_ops = call_ops, 804 .callback_ops = call_ops,
805 .callback_data = data, 805 .callback_data = data,
806 .workqueue = nfsiod_workqueue,
806 .flags = flags, 807 .flags = flags,
807 .priority = priority, 808 .priority = priority,
808 }; 809 };
@@ -1187,6 +1188,7 @@ static void nfs_commit_rpcsetup(struct list_head *head,
1187 .rpc_message = &msg, 1188 .rpc_message = &msg,
1188 .callback_ops = &nfs_commit_ops, 1189 .callback_ops = &nfs_commit_ops,
1189 .callback_data = data, 1190 .callback_data = data,
1191 .workqueue = nfsiod_workqueue,
1190 .flags = flags, 1192 .flags = flags,
1191 .priority = priority, 1193 .priority = priority,
1192 }; 1194 };