aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-31 19:45:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-31 19:45:47 -0500
commit75659ca0c10992dcb39258518368a0f6f56e935d (patch)
tree5d014ceb2f10158061a23d0d976f9a613d85e659 /fs/nfs
parentfbdde7bd274d74729954190f99afcb1e3d9bbfba (diff)
parent2dfe485a2c8afa54cb069fcf48476f6c90ea3fdf (diff)
Merge branch 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc
* 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc: (22 commits) Remove commented-out code copied from NFS NFS: Switch from intr mount option to TASK_KILLABLE Add wait_for_completion_killable Add wait_event_killable Add schedule_timeout_killable Use mutex_lock_killable in vfs_readdir Add mutex_lock_killable Use lock_page_killable Add lock_page_killable Add fatal_signal_pending Add TASK_WAKEKILL exit: Use task_is_* signal: Use task_is_* sched: Use task_contributes_to_load, TASK_ALL and TASK_NORMAL ptrace: Use task_is_* power: Use task_is_* wait: Use TASK_NORMAL proc/base.c: Use task_is_* proc/array.c: Use TASK_REPORT perfmon: Use task_is_* ... Fixed up conflicts in NFS/sunrpc manually..
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/client.c6
-rw-r--r--fs/nfs/direct.c7
-rw-r--r--fs/nfs/inode.c6
-rw-r--r--fs/nfs/mount_clnt.c2
-rw-r--r--fs/nfs/nfs3proc.c7
-rw-r--r--fs/nfs/nfs4proc.c27
-rw-r--r--fs/nfs/nfsroot.c3
-rw-r--r--fs/nfs/pagelist.c19
-rw-r--r--fs/nfs/super.c4
-rw-r--r--fs/nfs/write.c2
10 files changed, 19 insertions, 64 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 685c43f810c1..c5c0175898f6 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -386,7 +386,7 @@ found_client:
386 if (new) 386 if (new)
387 nfs_free_client(new); 387 nfs_free_client(new);
388 388
389 error = wait_event_interruptible(nfs_client_active_wq, 389 error = wait_event_killable(nfs_client_active_wq,
390 clp->cl_cons_state != NFS_CS_INITING); 390 clp->cl_cons_state != NFS_CS_INITING);
391 if (error < 0) { 391 if (error < 0) {
392 nfs_put_client(clp); 392 nfs_put_client(clp);
@@ -589,10 +589,6 @@ static int nfs_init_server_rpcclient(struct nfs_server *server,
589 if (server->flags & NFS_MOUNT_SOFT) 589 if (server->flags & NFS_MOUNT_SOFT)
590 server->client->cl_softrtry = 1; 590 server->client->cl_softrtry = 1;
591 591
592 server->client->cl_intr = 0;
593 if (server->flags & NFS4_MOUNT_INTR)
594 server->client->cl_intr = 1;
595
596 return 0; 592 return 0;
597} 593}
598 594
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index f8e165c7d5a6..16844f98f50e 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -188,17 +188,12 @@ static void nfs_direct_req_release(struct nfs_direct_req *dreq)
188static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq) 188static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq)
189{ 189{
190 ssize_t result = -EIOCBQUEUED; 190 ssize_t result = -EIOCBQUEUED;
191 struct rpc_clnt *clnt;
192 sigset_t oldset;
193 191
194 /* Async requests don't wait here */ 192 /* Async requests don't wait here */
195 if (dreq->iocb) 193 if (dreq->iocb)
196 goto out; 194 goto out;
197 195
198 clnt = NFS_CLIENT(dreq->inode); 196 result = wait_for_completion_killable(&dreq->completion);
199 rpc_clnt_sigmask(clnt, &oldset);
200 result = wait_for_completion_interruptible(&dreq->completion);
201 rpc_clnt_sigunmask(clnt, &oldset);
202 197
203 if (!result) 198 if (!result)
204 result = dreq->error; 199 result = dreq->error;
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 3f332e54e760..966a8850aa30 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -433,15 +433,11 @@ static int nfs_wait_schedule(void *word)
433 */ 433 */
434static int nfs_wait_on_inode(struct inode *inode) 434static int nfs_wait_on_inode(struct inode *inode)
435{ 435{
436 struct rpc_clnt *clnt = NFS_CLIENT(inode);
437 struct nfs_inode *nfsi = NFS_I(inode); 436 struct nfs_inode *nfsi = NFS_I(inode);
438 sigset_t oldmask;
439 int error; 437 int error;
440 438
441 rpc_clnt_sigmask(clnt, &oldmask);
442 error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING, 439 error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING,
443 nfs_wait_schedule, TASK_INTERRUPTIBLE); 440 nfs_wait_schedule, TASK_KILLABLE);
444 rpc_clnt_sigunmask(clnt, &oldmask);
445 441
446 return error; 442 return error;
447} 443}
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index 8afd9f7e7a97..49c7cd0502cc 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -56,7 +56,7 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path,
56 .program = &mnt_program, 56 .program = &mnt_program,
57 .version = version, 57 .version = version,
58 .authflavor = RPC_AUTH_UNIX, 58 .authflavor = RPC_AUTH_UNIX,
59 .flags = RPC_CLNT_CREATE_INTR, 59 .flags = 0,
60 }; 60 };
61 struct rpc_clnt *mnt_clnt; 61 struct rpc_clnt *mnt_clnt;
62 int status; 62 int status;
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index b353c1a05bfd..549dbce714a4 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -27,17 +27,14 @@
27static int 27static int
28nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) 28nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
29{ 29{
30 sigset_t oldset;
31 int res; 30 int res;
32 rpc_clnt_sigmask(clnt, &oldset);
33 do { 31 do {
34 res = rpc_call_sync(clnt, msg, flags); 32 res = rpc_call_sync(clnt, msg, flags);
35 if (res != -EJUKEBOX) 33 if (res != -EJUKEBOX)
36 break; 34 break;
37 schedule_timeout_interruptible(NFS_JUKEBOX_RETRY_TIME); 35 schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME);
38 res = -ERESTARTSYS; 36 res = -ERESTARTSYS;
39 } while (!signalled()); 37 } while (!fatal_signal_pending(current));
40 rpc_clnt_sigunmask(clnt, &oldset);
41 return res; 38 return res;
42} 39}
43 40
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5c189bd57eb2..027e1095256e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -316,12 +316,9 @@ static void nfs4_opendata_put(struct nfs4_opendata *p)
316 316
317static int nfs4_wait_for_completion_rpc_task(struct rpc_task *task) 317static int nfs4_wait_for_completion_rpc_task(struct rpc_task *task)
318{ 318{
319 sigset_t oldset;
320 int ret; 319 int ret;
321 320
322 rpc_clnt_sigmask(task->tk_client, &oldset);
323 ret = rpc_wait_for_completion_task(task); 321 ret = rpc_wait_for_completion_task(task);
324 rpc_clnt_sigunmask(task->tk_client, &oldset);
325 return ret; 322 return ret;
326} 323}
327 324
@@ -2785,9 +2782,9 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server)
2785 return 0; 2782 return 0;
2786} 2783}
2787 2784
2788static int nfs4_wait_bit_interruptible(void *word) 2785static int nfs4_wait_bit_killable(void *word)
2789{ 2786{
2790 if (signal_pending(current)) 2787 if (fatal_signal_pending(current))
2791 return -ERESTARTSYS; 2788 return -ERESTARTSYS;
2792 schedule(); 2789 schedule();
2793 return 0; 2790 return 0;
@@ -2795,18 +2792,14 @@ static int nfs4_wait_bit_interruptible(void *word)
2795 2792
2796static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp) 2793static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp)
2797{ 2794{
2798 sigset_t oldset;
2799 int res; 2795 int res;
2800 2796
2801 might_sleep(); 2797 might_sleep();
2802 2798
2803 rwsem_acquire(&clp->cl_sem.dep_map, 0, 0, _RET_IP_); 2799 rwsem_acquire(&clp->cl_sem.dep_map, 0, 0, _RET_IP_);
2804 2800
2805 rpc_clnt_sigmask(clnt, &oldset);
2806 res = wait_on_bit(&clp->cl_state, NFS4CLNT_STATE_RECOVER, 2801 res = wait_on_bit(&clp->cl_state, NFS4CLNT_STATE_RECOVER,
2807 nfs4_wait_bit_interruptible, 2802 nfs4_wait_bit_killable, TASK_KILLABLE);
2808 TASK_INTERRUPTIBLE);
2809 rpc_clnt_sigunmask(clnt, &oldset);
2810 2803
2811 rwsem_release(&clp->cl_sem.dep_map, 1, _RET_IP_); 2804 rwsem_release(&clp->cl_sem.dep_map, 1, _RET_IP_);
2812 return res; 2805 return res;
@@ -2814,7 +2807,6 @@ static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp)
2814 2807
2815static int nfs4_delay(struct rpc_clnt *clnt, long *timeout) 2808static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
2816{ 2809{
2817 sigset_t oldset;
2818 int res = 0; 2810 int res = 0;
2819 2811
2820 might_sleep(); 2812 might_sleep();
@@ -2823,14 +2815,9 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
2823 *timeout = NFS4_POLL_RETRY_MIN; 2815 *timeout = NFS4_POLL_RETRY_MIN;
2824 if (*timeout > NFS4_POLL_RETRY_MAX) 2816 if (*timeout > NFS4_POLL_RETRY_MAX)
2825 *timeout = NFS4_POLL_RETRY_MAX; 2817 *timeout = NFS4_POLL_RETRY_MAX;
2826 rpc_clnt_sigmask(clnt, &oldset); 2818 schedule_timeout_killable(*timeout);
2827 if (clnt->cl_intr) { 2819 if (fatal_signal_pending(current))
2828 schedule_timeout_interruptible(*timeout); 2820 res = -ERESTARTSYS;
2829 if (signalled())
2830 res = -ERESTARTSYS;
2831 } else
2832 schedule_timeout_uninterruptible(*timeout);
2833 rpc_clnt_sigunmask(clnt, &oldset);
2834 *timeout <<= 1; 2821 *timeout <<= 1;
2835 return res; 2822 return res;
2836} 2823}
@@ -3069,7 +3056,7 @@ int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4
3069static unsigned long 3056static unsigned long
3070nfs4_set_lock_task_retry(unsigned long timeout) 3057nfs4_set_lock_task_retry(unsigned long timeout)
3071{ 3058{
3072 schedule_timeout_interruptible(timeout); 3059 schedule_timeout_killable(timeout);
3073 timeout <<= 1; 3060 timeout <<= 1;
3074 if (timeout > NFS4_LOCK_MAXTIMEOUT) 3061 if (timeout > NFS4_LOCK_MAXTIMEOUT)
3075 return NFS4_LOCK_MAXTIMEOUT; 3062 return NFS4_LOCK_MAXTIMEOUT;
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index 4b0334590ee5..531379d36823 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -228,10 +228,7 @@ static int __init root_nfs_parse(char *name, char *buf)
228 nfs_data.flags &= ~NFS_MOUNT_SOFT; 228 nfs_data.flags &= ~NFS_MOUNT_SOFT;
229 break; 229 break;
230 case Opt_intr: 230 case Opt_intr:
231 nfs_data.flags |= NFS_MOUNT_INTR;
232 break;
233 case Opt_nointr: 231 case Opt_nointr:
234 nfs_data.flags &= ~NFS_MOUNT_INTR;
235 break; 232 break;
236 case Opt_posix: 233 case Opt_posix:
237 nfs_data.flags |= NFS_MOUNT_POSIX; 234 nfs_data.flags |= NFS_MOUNT_POSIX;
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 3b3dbb94393d..7f079209d70a 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -58,7 +58,6 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode,
58 struct page *page, 58 struct page *page,
59 unsigned int offset, unsigned int count) 59 unsigned int offset, unsigned int count)
60{ 60{
61 struct nfs_server *server = NFS_SERVER(inode);
62 struct nfs_page *req; 61 struct nfs_page *req;
63 62
64 for (;;) { 63 for (;;) {
@@ -67,7 +66,7 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode,
67 if (req != NULL) 66 if (req != NULL)
68 break; 67 break;
69 68
70 if (signalled() && (server->flags & NFS_MOUNT_INTR)) 69 if (fatal_signal_pending(current))
71 return ERR_PTR(-ERESTARTSYS); 70 return ERR_PTR(-ERESTARTSYS);
72 yield(); 71 yield();
73 } 72 }
@@ -177,11 +176,11 @@ void nfs_release_request(struct nfs_page *req)
177 kref_put(&req->wb_kref, nfs_free_request); 176 kref_put(&req->wb_kref, nfs_free_request);
178} 177}
179 178
180static int nfs_wait_bit_interruptible(void *word) 179static int nfs_wait_bit_killable(void *word)
181{ 180{
182 int ret = 0; 181 int ret = 0;
183 182
184 if (signal_pending(current)) 183 if (fatal_signal_pending(current))
185 ret = -ERESTARTSYS; 184 ret = -ERESTARTSYS;
186 else 185 else
187 schedule(); 186 schedule();
@@ -192,26 +191,18 @@ static int nfs_wait_bit_interruptible(void *word)
192 * nfs_wait_on_request - Wait for a request to complete. 191 * nfs_wait_on_request - Wait for a request to complete.
193 * @req: request to wait upon. 192 * @req: request to wait upon.
194 * 193 *
195 * Interruptible by signals only if mounted with intr flag. 194 * Interruptible by fatal signals only.
196 * The user is responsible for holding a count on the request. 195 * The user is responsible for holding a count on the request.
197 */ 196 */
198int 197int
199nfs_wait_on_request(struct nfs_page *req) 198nfs_wait_on_request(struct nfs_page *req)
200{ 199{
201 struct rpc_clnt *clnt = NFS_CLIENT(req->wb_context->path.dentry->d_inode);
202 sigset_t oldmask;
203 int ret = 0; 200 int ret = 0;
204 201
205 if (!test_bit(PG_BUSY, &req->wb_flags)) 202 if (!test_bit(PG_BUSY, &req->wb_flags))
206 goto out; 203 goto out;
207 /*
208 * Note: the call to rpc_clnt_sigmask() suffices to ensure that we
209 * are not interrupted if intr flag is not set
210 */
211 rpc_clnt_sigmask(clnt, &oldmask);
212 ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY, 204 ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY,
213 nfs_wait_bit_interruptible, TASK_INTERRUPTIBLE); 205 nfs_wait_bit_killable, TASK_KILLABLE);
214 rpc_clnt_sigunmask(clnt, &oldmask);
215out: 206out:
216 return ret; 207 return ret;
217} 208}
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 22c49c02897d..7f4505f6ac6f 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -448,7 +448,6 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
448 const char *nostr; 448 const char *nostr;
449 } nfs_info[] = { 449 } nfs_info[] = {
450 { NFS_MOUNT_SOFT, ",soft", ",hard" }, 450 { NFS_MOUNT_SOFT, ",soft", ",hard" },
451 { NFS_MOUNT_INTR, ",intr", ",nointr" },
452 { NFS_MOUNT_NOCTO, ",nocto", "" }, 451 { NFS_MOUNT_NOCTO, ",nocto", "" },
453 { NFS_MOUNT_NOAC, ",noac", "" }, 452 { NFS_MOUNT_NOAC, ",noac", "" },
454 { NFS_MOUNT_NONLM, ",nolock", "" }, 453 { NFS_MOUNT_NONLM, ",nolock", "" },
@@ -708,10 +707,7 @@ static int nfs_parse_mount_options(char *raw,
708 mnt->flags &= ~NFS_MOUNT_SOFT; 707 mnt->flags &= ~NFS_MOUNT_SOFT;
709 break; 708 break;
710 case Opt_intr: 709 case Opt_intr:
711 mnt->flags |= NFS_MOUNT_INTR;
712 break;
713 case Opt_nointr: 710 case Opt_nointr:
714 mnt->flags &= ~NFS_MOUNT_INTR;
715 break; 711 break;
716 case Opt_posix: 712 case Opt_posix:
717 mnt->flags |= NFS_MOUNT_POSIX; 713 mnt->flags |= NFS_MOUNT_POSIX;
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 5ac5b27b639a..522efff3e2c5 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -488,7 +488,7 @@ int nfs_reschedule_unstable_write(struct nfs_page *req)
488/* 488/*
489 * Wait for a request to complete. 489 * Wait for a request to complete.
490 * 490 *
491 * Interruptible by signals only if mounted with intr flag. 491 * Interruptible by fatal signals only.
492 */ 492 */
493static int nfs_wait_on_requests_locked(struct inode *inode, pgoff_t idx_start, unsigned int npages) 493static int nfs_wait_on_requests_locked(struct inode *inode, pgoff_t idx_start, unsigned int npages)
494{ 494{