NFS Killable tasks request comments on patch
Subsystems (4)
This patch builds on willy's TASK_INTERRUPTABLE and my own TASK_KILLABLE patches that are currently in the mm branch. ( see http://lkml.org/lkml/2007/10/18/423 and
http://lkml.org/lkml/2007/11/28/127 )
This patch removes the rpc sigmask code and changes the out_of_line_wait_on_bit and wait_on_bit calls in the sched.c file to use TASK_KILLABLE. The result of this patch is the ability to kill commands issued to a dead NFS mount by the normal ctrl+c method. I am looking for help getting this to work with commands that use the stat (and friends) system calls. These system calls seem to use spinlocks and are not killable-friendly due to the atomic operations involved. Does anyone have any thoughts on the patch so far or the remaining issues I am facing?
Please CC me on any responses.
Thanks,
Liam R. Howlett
--- fs/nfs/direct.c | 8 -------- fs/nfs/inode.c | 4 ---- fs/nfs/nfs3proc.c | 3 --- fs/nfs/nfs4proc.c | 9 --------- fs/nfs/pagelist.c | 4 ---- fs/nfs/read.c | 5 ----- fs/nfs/write.c | 5 ----- include/linux/nfs_fs.h | 2 -- net/sunrpc/clnt.c | 41 ----------------------------------------- net/sunrpc/sched.c | 4 ++-- net/sunrpc/sunrpc_syms.c | 2 -- 11 files changed, 2 insertions(+), 85 deletions(-)
fs/nfs/direct.c +0 -8
@@ -358,9 +358,7 @@ static ssize_t nfs_direct_read_schedule(struct nfs_direct_req *dreq, unsigned lostatic ssize_t nfs_direct_read (struct kiocb *iocb,unsigned long user_addr,size_t count,loff_t pos) {ssize_t result =0 ; -sigset_t oldset;struct inode *inode = iocb->ki_filp->f_mapping->host; -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_direct_req *dreq; dreq =nfs_direct_req_alloc ();
@@ -373,11 +371,9 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size dreq->iocb = iocb;nfs_add_stats (inode,NFSIOS_DIRECTREADBYTES , count); -rpc_clnt_sigmask (clnt, &oldset); result =nfs_direct_read_schedule (dreq, user_addr, count, pos);if (!result) result =nfs_direct_wait (dreq); -rpc_clnt_sigunmask (clnt, &oldset);nfs_direct_req_release (dreq);return result;
@@ -700,9 +696,7 @@ static ssize_t nfs_direct_write_schedule(struct nfs_direct_req *dreq, unsigned lstatic ssize_t nfs_direct_write (struct kiocb *iocb,unsigned long user_addr,size_t count,loff_t pos) {ssize_t result =0 ; -sigset_t oldset;struct inode *inode = iocb->ki_filp->f_mapping->host; -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_direct_req *dreq;size_t wsize =NFS_SERVER (inode)->wsize;int sync =0 ;
@@ -722,11 +716,9 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siznfs_add_stats (inode,NFSIOS_DIRECTWRITTENBYTES , count); -rpc_clnt_sigmask (clnt, &oldset); result =nfs_direct_write_schedule (dreq, user_addr, count, pos, sync);if (!result) result =nfs_direct_wait (dreq); -rpc_clnt_sigunmask (clnt, &oldset);nfs_direct_req_release (dreq);return result;
fs/nfs/inode.c +0 -4
@@ -433,15 +433,11 @@ static int nfs_wait_schedule(void *word)*/ static int nfs_wait_on_inode (struct inode *inode) { -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_inode *nfsi =NFS_I (inode); -sigset_t oldmask;int error; -rpc_clnt_sigmask (clnt, &oldmask); error =wait_on_bit_lock (&nfsi->flags,NFS_INO_REVALIDATING , nfs_wait_schedule,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldmask);return error; }
fs/nfs/nfs3proc.c +0 -3
@@ -27,9 +27,7 @@static int nfs3_rpc_wrapper (struct rpc_clnt *clnt,struct rpc_message *msg,int flags) { -sigset_t oldset;int res; -rpc_clnt_sigmask (clnt, &oldset); do { res = rpc_call_sync(clnt, msg, flags); if (res != -EJUKEBOX)
@@ -37,7 +35,6 @@ nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)schedule_timeout_interruptible (NFS_JUKEBOX_RETRY_TIME ); res = -ERESTARTSYS ; }while (!signalled ()); -rpc_clnt_sigunmask (clnt, &oldset);return res; }
fs/nfs/nfs4proc.c +0 -9
@@ -316,12 +316,9 @@ static void nfs4_opendata_put(struct nfs4_opendata *p)static int nfs4_wait_for_completion_rpc_task (struct rpc_task *task) { -sigset_t oldset;int ret; -rpc_clnt_sigmask (task->tk_client, &oldset); ret =rpc_wait_for_completion_task (task); -rpc_clnt_sigunmask (task->tk_client, &oldset);return ret; }
@@ -2816,18 +2813,15 @@ static int nfs4_wait_bit_interruptible(void *word)static int nfs4_wait_clnt_recover (struct rpc_clnt *clnt,struct nfs_client *clp) { -sigset_t oldset;int res;might_sleep ();rwsem_acquire (&clp->cl_sem.dep_map,0 ,0 , _RET_IP_); -rpc_clnt_sigmask (clnt, &oldset); res =wait_on_bit (&clp->cl_state,NFS4CLNT_STATE_RECOVER , nfs4_wait_bit_interruptible,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldset);rwsem_release (&clp->cl_sem.dep_map,1 , _RET_IP_);return res;
@@ -2835,7 +2829,6 @@ static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp)static int nfs4_delay (struct rpc_clnt *clnt,long *timeout) { -sigset_t oldset;int res =0 ;might_sleep ();
@@ -2844,14 +2837,12 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout) *timeout =NFS4_POLL_RETRY_MIN ;if (*timeout >NFS4_POLL_RETRY_MAX ) *timeout =NFS4_POLL_RETRY_MAX ; -rpc_clnt_sigmask (clnt, &oldset);if (clnt->cl_intr) {schedule_timeout_interruptible (*timeout);if (signalled ()) res = -ERESTARTSYS ; }else schedule_timeout_uninterruptible (*timeout); -rpc_clnt_sigunmask (clnt, &oldset); *timeout <<=1 ;return res; }
fs/nfs/pagelist.c +0 -4
@@ -196,8 +196,6 @@ static int nfs_wait_bit_interruptible(void *word)int nfs_wait_on_request (struct nfs_page *req) { -struct rpc_clnt *clnt =NFS_CLIENT (req->wb_context->path.dentry->d_inode); -sigset_t oldmask;int ret =0 ;if (!test_bit (PG_BUSY , &req->wb_flags))
@@ -206,10 +204,8 @@ nfs_wait_on_request(struct nfs_page *req)* Note: the call to rpc_clnt_sigmask() suffices to ensure that we * are not interrupted if intr flag is not set */ -rpc_clnt_sigmask (clnt, &oldmask); ret =out_of_line_wait_on_bit (&req->wb_flags,PG_BUSY , nfs_wait_bit_interruptible,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldmask); out:return ret; }
fs/nfs/read.c +0 -5
@@ -212,12 +212,7 @@ nfs_async_read_error(struct list_head *head)*/ static void nfs_execute_read (struct nfs_read_data *data) { -struct rpc_clnt *clnt =NFS_CLIENT (data->inode); -sigset_t oldset; - -rpc_clnt_sigmask (clnt, &oldset);rpc_execute (&data->task); -rpc_clnt_sigunmask (clnt, &oldset); }/*
fs/nfs/write.c +0 -5
@@ -816,12 +816,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,static void nfs_execute_write (struct nfs_write_data *data) { -struct rpc_clnt *clnt =NFS_CLIENT (data->inode); -sigset_t oldset; - -rpc_clnt_sigmask (clnt, &oldset);rpc_execute (&data->task); -rpc_clnt_sigunmask (clnt, &oldset); }/*
include/linux/nfs_fs.h +0 -2
@@ -520,9 +520,7 @@ extern void * nfs_root_data(void);int __retval =0 ; \if (clnt->cl_intr) { \sigset_t oldmask; \ -rpc_clnt_sigmask (clnt, &oldmask); \ __retval =wait_event_interruptible (wq, condition); \ -rpc_clnt_sigunmask (clnt, &oldmask); \ }else \wait_event (wq, condition); \ __retval; \
net/sunrpc/clnt.c +0 -41
65 lines not on this page · raw message
net/sunrpc/sched.c +2 -2
@@ -301,7 +301,7 @@ int __rpc_wait_for_completion_task(struct rpc_task *task, int (*action)(void *))if (action ==NULL ) action = rpc_wait_bit_interruptible;return wait_on_bit (&task->tk_runstate,RPC_TASK_ACTIVE , - action,TASK_INTERRUPTIBLE ); + action,TASK_KILLABLE ); }EXPORT_SYMBOL (__rpc_wait_for_completion_task);
@@ -693,7 +693,7 @@ static void __rpc_execute(struct rpc_task *task)/* Note: Caller should be using rpc_clnt_sigmask() */ status =out_of_line_wait_on_bit (&task->tk_runstate,RPC_TASK_QUEUED , rpc_wait_bit_interruptible, -TASK_INTERRUPTIBLE ); +TASK_KILLABLE );if (status == -ERESTARTSYS ) {/* * When a sync task receives a signal, it exits with
net/sunrpc/sunrpc_syms.c +0 -2
@@ -38,8 +38,6 @@ EXPORT_SYMBOL(rpc_killall_tasks);EXPORT_SYMBOL (rpc_call_sync);EXPORT_SYMBOL (rpc_call_async);EXPORT_SYMBOL (rpc_call_setup); -EXPORT_SYMBOL (rpc_clnt_sigmask); -EXPORT_SYMBOL (rpc_clnt_sigunmask);EXPORT_SYMBOL (rpc_delay);EXPORT_SYMBOL (rpc_restart_call);EXPORT_SYMBOL (rpc_setbufsize);
Signature · 1 line
1.5.2.5
fs/nfs/inode.c static int nfs_wait_schedule(void *word) · line 444
Quoted 13 lines · Liam Howlett
fs/nfs/inode.c +0
-4@@ -433,15 +433,11 @@ static int nfs_wait_schedule(void *word)*/ static int nfs_wait_on_inode (struct inode *inode) { -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_inode *nfsi =NFS_I (inode); -sigset_t oldmask;int error; -rpc_clnt_sigmask (clnt, &oldmask); error =wait_on_bit_lock (&nfsi->flags,NFS_INO_REVALIDATING , nfs_wait_schedule,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldmask);
Looks like you missed one case that should change to KILLABLE?
Quoted 4 lines
fs/nfs/nfs4proc.c +0
-1static int nfs4_wait_clnt_recover (struct rpc_clnt *clnt,struct nfs_client *clp) { -sigset_t oldset;int res;
fs/nfs/nfs4proc.c static int nfs4_wait_bit_interruptible(void *word) · line 2830
Quoted 10 lines
fs/nfs/nfs4proc.c +0
-2might_sleep ();rwsem_acquire (&clp->cl_sem.dep_map,0 ,0 , _RET_IP_); -rpc_clnt_sigmask (clnt, &oldset); res =wait_on_bit (&clp->cl_state,NFS4CLNT_STATE_RECOVER , nfs4_wait_bit_interruptible,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldset);
Ditto
fs/nfs/nfs4proc.c static int nfs4_delay(struct rpc_clnt *clnt, long *timeout) · line 2854
Quoted 12 lines
fs/nfs/nfs4proc.c +0
-2@@ -2844,14 +2837,12 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout) *timeout =NFS4_POLL_RETRY_MIN ;if (*timeout >NFS4_POLL_RETRY_MAX ) *timeout =NFS4_POLL_RETRY_MAX ; -rpc_clnt_sigmask (clnt, &oldset);if (clnt->cl_intr) {schedule_timeout_interruptible (*timeout);if (signalled ()) res = -ERESTARTSYS ; }else schedule_timeout_uninterruptible (*timeout); -rpc_clnt_sigunmask (clnt, &oldset);
Hmm ... guess we need a schedule_timeout_killable. This should probably look like:
if (*timeout > NFS4_POLL_RETRY_MAX) *timeout = NFS4_POLL_RETRY_MAX; + schedule_timeout_killable(*timeout); + if (fatal_signalled()) res = -ERESTARTSYS;
*timeout <<= 1;
fs/nfs/pagelist.c nfs_wait_on_request(struct nfs_page *req) · line 212
Quoted 8 lines
fs/nfs/pagelist.c +0
-2@@ -206,10 +204,8 @@ nfs_wait_on_request(struct nfs_page *req)* Note: the call to rpc_clnt_sigmask() suffices to ensure that we * are not interrupted if intr flag is not set */ -rpc_clnt_sigmask (clnt, &oldmask); ret =out_of_line_wait_on_bit (&req->wb_flags,PG_BUSY , nfs_wait_bit_interruptible,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldmask);
Another missing KILLABLE.
include/linux/nfs_fs.h extern void * nfs_root_data(void); · line 526
Quoted 10 lines
include/linux/nfs_fs.h +0
-2@@ -520,9 +520,7 @@ extern void * nfs_root_data(void);int __retval =0 ; \if (clnt->cl_intr) { \sigset_t oldmask; \ -rpc_clnt_sigmask (clnt, &oldmask); \ __retval =wait_event_interruptible (wq, condition); \ -rpc_clnt_sigunmask (clnt, &oldmask); \ }else \wait_event (wq, condition); \ __retval; \
wait_event_killable?
Anyway, none of these explain the non-killability of the *stat* calls.
Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
Quoted 4 lines · Liam Howlett
This patch removes the rpc sigmask code and changes the
out_of_line_wait_on_bitandwait_on_bitcalls in thesched.cfile to useTASK_KILLABLE. The result of this patch is the ability to kill commands issued to a dead NFS mount by the normal ctrl+c method. I am
I've done a more thorough review of Liam's work and come up with a few more fixes (which I'll publish later today), but more importantly, a list of questions for the NFS/RPC people:
1. __nfs_revalidate_inode - with an error return from nfs_wait_on_inode(), shouldn't we go to out_nowait()?
2. nfs4_set_lock_task_retry - shouldn't we honour the fatal signal, and, say, set the timeout to MAXTIMEOUT?
3. Can we make nfs use rpc_wait_bit_killable()? I think there's two places that exact function is duplicated.
4. Can we remove the 'action' parameter from __rpc_wait_for_completion_task()? It's always NULL.
5. Should xprt_rdma_free be using wait_event_killable? Ditto rpcrdma_ep_connect and rpcrdma_ep_disconnect
I think we're going to find a lot of places where attention hasn't been paid to the 'intr' case. It's always been a wart, so I'm unsurprised it doesn't get much testing.
Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
Quoted 2 lines · Matthew Wilcox
I've done a more thorough review of Liam's work and come up with a few more fixes (which I'll publish later today)
I've put up a git tree for this work; see
http://git.kernel.org/?p=linux/kernel/git/willy/misc.git;a=shortlog;h=task_killable
I've split up some of the earlier patches, hopefully in a way which will make akpm less grumpy. Andrew, let me know if I've misunderstood how you want to see it.
Here's the commit for the NFS people to chew on a bit.
commit f05b88f294044cdf56fbe637a246ba6c7a14d6f1
Author: Matthew Wilcox <[email protected]> Date: Thu Dec 6 16:24:39 2007 -0500
NFS: Switch from intr mount option to TASK_KILLABLE
By using the TASK_KILLABLE infrastructure, we can get rid of the 'intr' mount option. We have to use _killable everywhere instead of _interruptible as we get rid of rpc_clnt_sigmask/sigunmask.
fs/nfs/client.c +1 -5
@@ -302,7 +302,7 @@ found_client:if (new)nfs_free_client (new); - error =wait_event_interruptible (nfs_client_active_wq, + error =wait_event_killable (nfs_client_active_wq, clp->cl_cons_state !=NFS_CS_INITING );if (error <0 ) {nfs_put_client (clp);
@@ -494,10 +494,6 @@ static int nfs_init_server_rpcclient(struct nfs_server *server, rpc_authflavor_tif (server->flags &NFS_MOUNT_SOFT ) server->client->cl_softrtry =1 ; - server->client->cl_intr =0 ; -if (server->flags &NFS4_MOUNT_INTR ) - server->client->cl_intr =1 ; -return 0 ; }
fs/nfs/direct.c +1 -9
@@ -193,7 +193,7 @@ static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq)if (dreq->iocb) goto out; - result =wait_for_completion_interruptible (&dreq->completion); + result =wait_for_completion_killable (&dreq->completion);if (!result) result = dreq->error;
@@ -391,9 +391,7 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { ssize_t result = 0; -sigset_t oldset;struct inode *inode = iocb->ki_filp->f_mapping->host; -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_direct_req *dreq; dreq =nfs_direct_req_alloc ();
@@ -405,11 +403,9 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,if (!is_sync_kiocb (iocb)) dreq->iocb = iocb; -rpc_clnt_sigmask (clnt, &oldset); result =nfs_direct_read_schedule_iovec (dreq, iov, nr_segs, pos);if (!result) result =nfs_direct_wait (dreq); -rpc_clnt_sigunmask (clnt, &oldset);nfs_direct_req_release (dreq);return result;
@@ -767,9 +763,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov, size_t count) {ssize_t result =0 ; -sigset_t oldset;struct inode *inode = iocb->ki_filp->f_mapping->host; -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_direct_req *dreq;size_t wsize =NFS_SERVER (inode)->wsize;int sync =0 ;
@@ -787,11 +781,9 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,if (!is_sync_kiocb (iocb)) dreq->iocb = iocb; -rpc_clnt_sigmask (clnt, &oldset); result =nfs_direct_write_schedule_iovec (dreq, iov, nr_segs, pos, sync);if (!result) result =nfs_direct_wait (dreq); -rpc_clnt_sigunmask (clnt, &oldset);nfs_direct_req_release (dreq);return result;
fs/nfs/inode.c +1 -5
@@ -433,15 +433,11 @@ static int nfs_wait_schedule(void *word)*/ static int nfs_wait_on_inode (struct inode *inode) { -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_inode *nfsi =NFS_I (inode); -sigset_t oldmask;int error; -rpc_clnt_sigmask (clnt, &oldmask); error =wait_on_bit_lock (&nfsi->flags,NFS_INO_REVALIDATING , - nfs_wait_schedule,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldmask); + nfs_wait_schedule,TASK_KILLABLE );return error; }
fs/nfs/mount_clnt.c +1 -1
@@ -56,7 +56,7 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path, .program = &mnt_program, .version = version, .authflavor = RPC_AUTH_UNIX, - .flags = RPC_CLNT_CREATE_INTR, + .flags = 0, };struct rpc_clnt *mnt_clnt;int status;
fs/nfs/nfs3proc.c +2 -5
@@ -27,17 +27,14 @@static int nfs3_rpc_wrapper (struct rpc_clnt *clnt,struct rpc_message *msg,int flags) { -sigset_t oldset;int res; -rpc_clnt_sigmask (clnt, &oldset);do { res =rpc_call_sync (clnt, msg, flags);if (res != -EJUKEBOX )break ; -schedule_timeout_interruptible (NFS_JUKEBOX_RETRY_TIME ); +schedule_timeout_killable (NFS_JUKEBOX_RETRY_TIME ); res = -ERESTARTSYS ; - }while (!signalled ()); -rpc_clnt_sigunmask (clnt, &oldset); + }while (!fatal_signal_pending (current));return res; }
fs/nfs/nfs4proc.c +7 -20
@@ -316,12 +316,9 @@ static void nfs4_opendata_put(struct nfs4_opendata *p)static int nfs4_wait_for_completion_rpc_task (struct rpc_task *task) { -sigset_t oldset;int ret; -rpc_clnt_sigmask (task->tk_client, &oldset); ret =rpc_wait_for_completion_task (task); -rpc_clnt_sigunmask (task->tk_client, &oldset);return ret; }
@@ -2806,9 +2803,9 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server)return 0 ; } -static int nfs4_wait_bit_interruptible (void *word) +static int nfs4_wait_bit_killable (void *word) { -if (signal_pending (current)) +if (fatal_signal_pending (current))return -ERESTARTSYS ;schedule ();return 0 ;
@@ -2816,18 +2813,14 @@ static int nfs4_wait_bit_interruptible(void *word)static int nfs4_wait_clnt_recover (struct rpc_clnt *clnt,struct nfs_client *clp) { -sigset_t oldset;int res;might_sleep ();rwsem_acquire (&clp->cl_sem.dep_map,0 ,0 , _RET_IP_); -rpc_clnt_sigmask (clnt, &oldset); res =wait_on_bit (&clp->cl_state,NFS4CLNT_STATE_RECOVER , - nfs4_wait_bit_interruptible, -TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldset); + nfs4_wait_bit_killable,TASK_KILLABLE );rwsem_release (&clp->cl_sem.dep_map,1 , _RET_IP_);return res;
@@ -2835,7 +2828,6 @@ static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp)static int nfs4_delay (struct rpc_clnt *clnt,long *timeout) { -sigset_t oldset;int res =0 ;might_sleep ();
@@ -2844,14 +2836,9 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout) *timeout =NFS4_POLL_RETRY_MIN ;if (*timeout >NFS4_POLL_RETRY_MAX ) *timeout =NFS4_POLL_RETRY_MAX ; -rpc_clnt_sigmask (clnt, &oldset); -if (clnt->cl_intr) { -schedule_timeout_interruptible (*timeout); -if (signalled ()) - res = -ERESTARTSYS ; - }else -schedule_timeout_uninterruptible (*timeout); -rpc_clnt_sigunmask (clnt, &oldset); +schedule_timeout_killable (*timeout); +if (fatal_signal_pending (current)) + res = -ERESTARTSYS ; *timeout <<=1 ;return res; }
@@ -3085,7 +3072,7 @@ int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4static unsigned long nfs4_set_lock_task_retry (unsigned long timeout) { -schedule_timeout_interruptible (timeout); +schedule_timeout_killable (timeout); timeout <<=1 ;if (timeout >NFS4_LOCK_MAXTIMEOUT )return NFS4_LOCK_MAXTIMEOUT ;
fs/nfs/nfsroot.c +0 -3
@@ -228,10 +228,7 @@ static int __init root_nfs_parse(char *name, char *buf) nfs_data.flags &= ~NFS_MOUNT_SOFT ;break ;case Opt_intr: - nfs_data.flags |=NFS_MOUNT_INTR ; -break ;case Opt_nointr: - nfs_data.flags &= ~NFS_MOUNT_INTR ;break ;case Opt_posix: nfs_data.flags |=NFS_MOUNT_POSIX ;
fs/nfs/pagelist.c +5 -13
@@ -67,7 +67,7 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode,if (req !=NULL )break ; -if (signalled () && (server->flags &NFS_MOUNT_INTR )) +if (fatal_signal_pending (current))return ERR_PTR (-ERESTARTSYS );yield (); }
@@ -175,11 +175,11 @@ void nfs_release_request(struct nfs_page *req)kref_put (&req->wb_kref, nfs_free_request); } -static int nfs_wait_bit_interruptible (void *word) +static int nfs_wait_bit_killable (void *word) {int ret =0 ; -if (signal_pending (current)) +if (fatal_signal_pending (current)) ret = -ERESTARTSYS ;else schedule ();
@@ -190,26 +190,18 @@ static int nfs_wait_bit_interruptible(void *word)* nfs_wait_on_request - Wait for a request to complete. * @req: request to wait upon. * -* Interruptible by signals only if mounted with intr flag. +* Interruptible by fatal signals only. * The user is responsible for holding a count on the request. */ int nfs_wait_on_request (struct nfs_page *req) { -struct rpc_clnt *clnt =NFS_CLIENT (req->wb_context->path.dentry->d_inode); -sigset_t oldmask;int ret =0 ;if (!test_bit (PG_BUSY , &req->wb_flags)) goto out; -/* -* Note: the call to rpc_clnt_sigmask() suffices to ensure that we -* are not interrupted if intr flag is not set -*/ -rpc_clnt_sigmask (clnt, &oldmask); ret =out_of_line_wait_on_bit (&req->wb_flags,PG_BUSY , - nfs_wait_bit_interruptible,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldmask); + nfs_wait_bit_killable,TASK_KILLABLE ); out:return ret; }
fs/nfs/read.c +0 -5
@@ -212,12 +212,7 @@ nfs_async_read_error(struct list_head *head)*/ static void nfs_execute_read (struct nfs_read_data *data) { -struct rpc_clnt *clnt =NFS_CLIENT (data->inode); -sigset_t oldset; - -rpc_clnt_sigmask (clnt, &oldset);rpc_execute (&data->task); -rpc_clnt_sigunmask (clnt, &oldset); }/*
fs/nfs/super.c +0 -4
@@ -424,7 +424,6 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,const char *nostr; } nfs_info[] = { { NFS_MOUNT_SOFT, ",soft", ",hard" }, - { NFS_MOUNT_INTR, ",intr", ",nointr" }, { NFS_MOUNT_NOCTO, ",nocto", "" }, { NFS_MOUNT_NOAC, ",noac", "" }, { NFS_MOUNT_NONLM, ",nolock", "" },
@@ -624,10 +623,7 @@ static int nfs_parse_mount_options(char *raw, mnt->flags &= ~NFS_MOUNT_SOFT ;break ;case Opt_intr: - mnt->flags |=NFS_MOUNT_INTR ; -break ;case Opt_nointr: - mnt->flags &= ~NFS_MOUNT_INTR ;break ;case Opt_posix: mnt->flags |=NFS_MOUNT_POSIX ;
fs/nfs/write.c +1 -6
@@ -490,7 +490,7 @@ int nfs_reschedule_unstable_write(struct nfs_page *req)/* * Wait for a request to complete. * -* Interruptible by signals only if mounted with intr flag. +* Interruptible by fatal signals only. */ static int nfs_wait_on_requests_locked (struct inode *inode,pgoff_t idx_start,unsigned int npages) {
@@ -816,12 +816,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,static void nfs_execute_write (struct nfs_write_data *data) { -struct rpc_clnt *clnt =NFS_CLIENT (data->inode); -sigset_t oldset; - -rpc_clnt_sigmask (clnt, &oldset);rpc_execute (&data->task); -rpc_clnt_sigunmask (clnt, &oldset); }/*
include/linux/nfs_fs.h +1 -8
@@ -516,14 +516,7 @@ extern void * nfs_root_data(void);#define nfs_wait_event (clnt, wq, condition) \ ({ \ - int __retval = 0; \ - if (clnt->cl_intr) { \ - sigset_t oldmask; \ - rpc_clnt_sigmask(clnt, &oldmask); \ - __retval = wait_event_interruptible(wq, condition); \ - rpc_clnt_sigunmask(clnt, &oldmask); \ - } else \ - wait_event(wq, condition); \ + int __retval = wait_event_killable(wq, condition); \ __retval; \ })
include/linux/nfs_mount.h +1 -1
@@ -48,7 +48,7 @@ struct nfs_mount_data {/* bits in the flags field */ #define NFS_MOUNT_SOFT 0x0001/* 1 */ -#define NFS_MOUNT_INTR 0x0002/* 1 */ +#define NFS_MOUNT_INTR 0x0002/* 1 */ /* now unused, but ABI */ #define NFS_MOUNT_SECURE 0x0004/* 1 */ #define NFS_MOUNT_POSIX 0x0008/* 1 */ #define NFS_MOUNT_NOCTO 0x0010/* 1 */
include/linux/sunrpc/clnt.h +0 -2
@@ -41,7 +41,6 @@ struct rpc_clnt {struct rpc_iostats * cl_metrics;/* per-client statistics */ unsigned int cl_softrtry : 1,/* soft timeouts */ - cl_intr : 1,/* interruptible */ cl_discrtry : 1,/* disconnect before retry */ cl_autobind : 1;/* use getport() */
@@ -109,7 +108,6 @@ struct rpc_create_args {/* Values for "flags" field */ #define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) -#define RPC_CLNT_CREATE_INTR (1UL << 1)#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2)#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3)#define RPC_CLNT_CREATE_NOPING (1UL << 4)
include/linux/sunrpc/sched.h +0 -2
@@ -128,7 +128,6 @@ struct rpc_call_ops {#define RPC_TASK_DYNAMIC 0x0080/* task was kmalloc'ed */ #define RPC_TASK_KILLED 0x0100/* task was killed */ #define RPC_TASK_SOFT 0x0200/* Use soft timeouts */ -#define RPC_TASK_NOINTR 0x0400/* uninterruptible task */ #define RPC_IS_ASYNC (t) ((t)->tk_flags & RPC_TASK_ASYNC)#define RPC_IS_SWAPPER (t) ((t)->tk_flags & RPC_TASK_SWAPPER)
@@ -136,7 +135,6 @@ struct rpc_call_ops {#define RPC_ASSASSINATED (t) ((t)->tk_flags & RPC_TASK_KILLED)#define RPC_DO_CALLBACK (t) ((t)->tk_callback != NULL)#define RPC_IS_SOFT (t) ((t)->tk_flags & RPC_TASK_SOFT) -#define RPC_TASK_UNINTERRUPTIBLE (t) ((t)->tk_flags & RPC_TASK_NOINTR)#define RPC_TASK_RUNNING 0#define RPC_TASK_QUEUED 1
net/sunrpc/clnt.c +2 -45
89 lines not on this page · raw message
net/sunrpc/rpcb_clnt.c +1 -2
@@ -172,8 +172,7 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr, .program = &rpcb_program, .version = version, .authflavor = RPC_AUTH_UNIX, - .flags = (RPC_CLNT_CREATE_NOPING | - RPC_CLNT_CREATE_INTR), + .flags = RPC_CLNT_CREATE_NOPING, };switch (srvaddr->sa_family) {
net/sunrpc/sched.c +6 -9
@@ -245,9 +245,9 @@ void rpc_init_wait_queue(struct rpc_wait_queue *queue, const char *qname) }EXPORT_SYMBOL (rpc_init_wait_queue); -static int rpc_wait_bit_interruptible (void *word) +static int rpc_wait_bit_killable (void *word) { -if (signal_pending (current)) +if (fatal_signal_pending (current))return -ERESTARTSYS ;schedule ();return 0 ;
@@ -299,9 +299,9 @@ static void rpc_mark_complete_task(struct rpc_task *task)int __rpc_wait_for_completion_task (struct rpc_task *task,int (*action)(void *)) {if (action ==NULL ) - action = rpc_wait_bit_interruptible; + action = rpc_wait_bit_killable;return wait_on_bit (&task->tk_runstate,RPC_TASK_ACTIVE , - action,TASK_INTERRUPTIBLE ); + action,TASK_KILLABLE ); }EXPORT_SYMBOL (__rpc_wait_for_completion_task);
@@ -690,10 +690,9 @@ static void __rpc_execute(struct rpc_task *task)/* sync task: sleep here */ dprintk ("RPC: %5u sync task going to sleep\n" , task->tk_pid); -/* Note: Caller should be using rpc_clnt_sigmask() */ status =out_of_line_wait_on_bit (&task->tk_runstate, -RPC_TASK_QUEUED , rpc_wait_bit_interruptible, -TASK_INTERRUPTIBLE ); +RPC_TASK_QUEUED , rpc_wait_bit_killable, +TASK_KILLABLE );if (status == -ERESTARTSYS ) {/* * When a sync task receives a signal, it exits with
@@ -837,8 +836,6 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, int flags, conskref_get (&clnt->cl_kref);if (clnt->cl_softrtry) task->tk_flags |=RPC_TASK_SOFT ; -if (!clnt->cl_intr) - task->tk_flags |=RPC_TASK_NOINTR ; }BUG_ON (task->tk_ops ==NULL );
net/sunrpc/sunrpc_syms.c +0 -2
@@ -38,8 +38,6 @@ EXPORT_SYMBOL(rpc_killall_tasks);EXPORT_SYMBOL (rpc_call_sync);EXPORT_SYMBOL (rpc_call_async);EXPORT_SYMBOL (rpc_call_setup); -EXPORT_SYMBOL (rpc_clnt_sigmask); -EXPORT_SYMBOL (rpc_clnt_sigunmask);EXPORT_SYMBOL (rpc_delay);EXPORT_SYMBOL (rpc_restart_call);EXPORT_SYMBOL (rpc_setbufsize);
Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
Quoted 2 lines · Matthew Wilcox
I've done a more thorough review of Liam's work and come up with a few more fixes (which I'll publish later today)
I've put up a git tree for this work; see
http://git.kernel.org/?p=linux/kernel/git/willy/misc.git;a=shortlog;h=task_killable
I've split up some of the earlier patches, hopefully in a way which will make akpm less grumpy. Andrew, let me know if I've misunderstood how you want to see it.
Here's the commit for the NFS people to chew on a bit.
commit f05b88f294044cdf56fbe637a246ba6c7a14d6f1
Author: Matthew Wilcox <[email protected]> Date: Thu Dec 6 16:24:39 2007 -0500
NFS: Switch from intr mount option to TASK_KILLABLE
By using the TASK_KILLABLE infrastructure, we can get rid of the 'intr' mount option. We have to use _killable everywhere instead of _interruptible as we get rid of rpc_clnt_sigmask/sigunmask.
fs/nfs/client.c +1 -5
@@ -302,7 +302,7 @@ found_client:if (new)nfs_free_client (new); - error =wait_event_interruptible (nfs_client_active_wq, + error =wait_event_killable (nfs_client_active_wq, clp->cl_cons_state !=NFS_CS_INITING );if (error <0 ) {nfs_put_client (clp);
@@ -494,10 +494,6 @@ static int nfs_init_server_rpcclient(struct nfs_server *server, rpc_authflavor_tif (server->flags &NFS_MOUNT_SOFT ) server->client->cl_softrtry =1 ; - server->client->cl_intr =0 ; -if (server->flags &NFS4_MOUNT_INTR ) - server->client->cl_intr =1 ; -return 0 ; }
fs/nfs/direct.c +1 -9
@@ -193,7 +193,7 @@ static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq)if (dreq->iocb) goto out; - result =wait_for_completion_interruptible (&dreq->completion); + result =wait_for_completion_killable (&dreq->completion);if (!result) result = dreq->error;
@@ -391,9 +391,7 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { ssize_t result = 0; -sigset_t oldset;struct inode *inode = iocb->ki_filp->f_mapping->host; -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_direct_req *dreq; dreq =nfs_direct_req_alloc ();
@@ -405,11 +403,9 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,if (!is_sync_kiocb (iocb)) dreq->iocb = iocb; -rpc_clnt_sigmask (clnt, &oldset); result =nfs_direct_read_schedule_iovec (dreq, iov, nr_segs, pos);if (!result) result =nfs_direct_wait (dreq); -rpc_clnt_sigunmask (clnt, &oldset);nfs_direct_req_release (dreq);return result;
@@ -767,9 +763,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov, size_t count) {ssize_t result =0 ; -sigset_t oldset;struct inode *inode = iocb->ki_filp->f_mapping->host; -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_direct_req *dreq;size_t wsize =NFS_SERVER (inode)->wsize;int sync =0 ;
@@ -787,11 +781,9 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,if (!is_sync_kiocb (iocb)) dreq->iocb = iocb; -rpc_clnt_sigmask (clnt, &oldset); result =nfs_direct_write_schedule_iovec (dreq, iov, nr_segs, pos, sync);if (!result) result =nfs_direct_wait (dreq); -rpc_clnt_sigunmask (clnt, &oldset);nfs_direct_req_release (dreq);return result;
fs/nfs/inode.c +1 -5
@@ -433,15 +433,11 @@ static int nfs_wait_schedule(void *word)*/ static int nfs_wait_on_inode (struct inode *inode) { -struct rpc_clnt *clnt =NFS_CLIENT (inode);struct nfs_inode *nfsi =NFS_I (inode); -sigset_t oldmask;int error; -rpc_clnt_sigmask (clnt, &oldmask); error =wait_on_bit_lock (&nfsi->flags,NFS_INO_REVALIDATING , - nfs_wait_schedule,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldmask); + nfs_wait_schedule,TASK_KILLABLE );return error; }
fs/nfs/mount_clnt.c +1 -1
@@ -56,7 +56,7 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path, .program = &mnt_program, .version = version, .authflavor = RPC_AUTH_UNIX, - .flags = RPC_CLNT_CREATE_INTR, + .flags = 0, };struct rpc_clnt *mnt_clnt;int status;
fs/nfs/nfs3proc.c +2 -5
@@ -27,17 +27,14 @@static int nfs3_rpc_wrapper (struct rpc_clnt *clnt,struct rpc_message *msg,int flags) { -sigset_t oldset;int res; -rpc_clnt_sigmask (clnt, &oldset);do { res =rpc_call_sync (clnt, msg, flags);if (res != -EJUKEBOX )break ; -schedule_timeout_interruptible (NFS_JUKEBOX_RETRY_TIME ); +schedule_timeout_killable (NFS_JUKEBOX_RETRY_TIME ); res = -ERESTARTSYS ; - }while (!signalled ()); -rpc_clnt_sigunmask (clnt, &oldset); + }while (!fatal_signal_pending (current));return res; }
fs/nfs/nfs4proc.c +7 -20
@@ -316,12 +316,9 @@ static void nfs4_opendata_put(struct nfs4_opendata *p)static int nfs4_wait_for_completion_rpc_task (struct rpc_task *task) { -sigset_t oldset;int ret; -rpc_clnt_sigmask (task->tk_client, &oldset); ret =rpc_wait_for_completion_task (task); -rpc_clnt_sigunmask (task->tk_client, &oldset);return ret; }
@@ -2806,9 +2803,9 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server)return 0 ; } -static int nfs4_wait_bit_interruptible (void *word) +static int nfs4_wait_bit_killable (void *word) { -if (signal_pending (current)) +if (fatal_signal_pending (current))return -ERESTARTSYS ;schedule ();return 0 ;
@@ -2816,18 +2813,14 @@ static int nfs4_wait_bit_interruptible(void *word)static int nfs4_wait_clnt_recover (struct rpc_clnt *clnt,struct nfs_client *clp) { -sigset_t oldset;int res;might_sleep ();rwsem_acquire (&clp->cl_sem.dep_map,0 ,0 , _RET_IP_); -rpc_clnt_sigmask (clnt, &oldset); res =wait_on_bit (&clp->cl_state,NFS4CLNT_STATE_RECOVER , - nfs4_wait_bit_interruptible, -TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldset); + nfs4_wait_bit_killable,TASK_KILLABLE );rwsem_release (&clp->cl_sem.dep_map,1 , _RET_IP_);return res;
@@ -2835,7 +2828,6 @@ static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp)static int nfs4_delay (struct rpc_clnt *clnt,long *timeout) { -sigset_t oldset;int res =0 ;might_sleep ();
@@ -2844,14 +2836,9 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout) *timeout =NFS4_POLL_RETRY_MIN ;if (*timeout >NFS4_POLL_RETRY_MAX ) *timeout =NFS4_POLL_RETRY_MAX ; -rpc_clnt_sigmask (clnt, &oldset); -if (clnt->cl_intr) { -schedule_timeout_interruptible (*timeout); -if (signalled ()) - res = -ERESTARTSYS ; - }else -schedule_timeout_uninterruptible (*timeout); -rpc_clnt_sigunmask (clnt, &oldset); +schedule_timeout_killable (*timeout); +if (fatal_signal_pending (current)) + res = -ERESTARTSYS ; *timeout <<=1 ;return res; }
@@ -3085,7 +3072,7 @@ int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4static unsigned long nfs4_set_lock_task_retry (unsigned long timeout) { -schedule_timeout_interruptible (timeout); +schedule_timeout_killable (timeout); timeout <<=1 ;if (timeout >NFS4_LOCK_MAXTIMEOUT )return NFS4_LOCK_MAXTIMEOUT ;
fs/nfs/nfsroot.c +0 -3
@@ -228,10 +228,7 @@ static int __init root_nfs_parse(char *name, char *buf) nfs_data.flags &= ~NFS_MOUNT_SOFT ;break ;case Opt_intr: - nfs_data.flags |=NFS_MOUNT_INTR ; -break ;case Opt_nointr: - nfs_data.flags &= ~NFS_MOUNT_INTR ;break ;case Opt_posix: nfs_data.flags |=NFS_MOUNT_POSIX ;
fs/nfs/pagelist.c +5 -13
@@ -67,7 +67,7 @@ nfs_create_request(struct nfs_open_context *ctx, struct inode *inode,if (req !=NULL )break ; -if (signalled () && (server->flags &NFS_MOUNT_INTR )) +if (fatal_signal_pending (current))return ERR_PTR (-ERESTARTSYS );yield (); }
@@ -175,11 +175,11 @@ void nfs_release_request(struct nfs_page *req)kref_put (&req->wb_kref, nfs_free_request); } -static int nfs_wait_bit_interruptible (void *word) +static int nfs_wait_bit_killable (void *word) {int ret =0 ; -if (signal_pending (current)) +if (fatal_signal_pending (current)) ret = -ERESTARTSYS ;else schedule ();
@@ -190,26 +190,18 @@ static int nfs_wait_bit_interruptible(void *word)* nfs_wait_on_request - Wait for a request to complete. * @req: request to wait upon. * -* Interruptible by signals only if mounted with intr flag. +* Interruptible by fatal signals only. * The user is responsible for holding a count on the request. */ int nfs_wait_on_request (struct nfs_page *req) { -struct rpc_clnt *clnt =NFS_CLIENT (req->wb_context->path.dentry->d_inode); -sigset_t oldmask;int ret =0 ;if (!test_bit (PG_BUSY , &req->wb_flags)) goto out; -/* -* Note: the call to rpc_clnt_sigmask() suffices to ensure that we -* are not interrupted if intr flag is not set -*/ -rpc_clnt_sigmask (clnt, &oldmask); ret =out_of_line_wait_on_bit (&req->wb_flags,PG_BUSY , - nfs_wait_bit_interruptible,TASK_INTERRUPTIBLE ); -rpc_clnt_sigunmask (clnt, &oldmask); + nfs_wait_bit_killable,TASK_KILLABLE ); out:return ret; }
fs/nfs/read.c +0 -5
@@ -212,12 +212,7 @@ nfs_async_read_error(struct list_head *head)*/ static void nfs_execute_read (struct nfs_read_data *data) { -struct rpc_clnt *clnt =NFS_CLIENT (data->inode); -sigset_t oldset; - -rpc_clnt_sigmask (clnt, &oldset);rpc_execute (&data->task); -rpc_clnt_sigunmask (clnt, &oldset); }/*
fs/nfs/super.c +0 -4
@@ -424,7 +424,6 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,const char *nostr; } nfs_info[] = { { NFS_MOUNT_SOFT, ",soft", ",hard" }, - { NFS_MOUNT_INTR, ",intr", ",nointr" }, { NFS_MOUNT_NOCTO, ",nocto", "" }, { NFS_MOUNT_NOAC, ",noac", "" }, { NFS_MOUNT_NONLM, ",nolock", "" },
@@ -624,10 +623,7 @@ static int nfs_parse_mount_options(char *raw, mnt->flags &= ~NFS_MOUNT_SOFT ;break ;case Opt_intr: - mnt->flags |=NFS_MOUNT_INTR ; -break ;case Opt_nointr: - mnt->flags &= ~NFS_MOUNT_INTR ;break ;case Opt_posix: mnt->flags |=NFS_MOUNT_POSIX ;
fs/nfs/write.c +1 -6
@@ -490,7 +490,7 @@ int nfs_reschedule_unstable_write(struct nfs_page *req)/* * Wait for a request to complete. * -* Interruptible by signals only if mounted with intr flag. +* Interruptible by fatal signals only. */ static int nfs_wait_on_requests_locked (struct inode *inode,pgoff_t idx_start,unsigned int npages) {
@@ -816,12 +816,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,static void nfs_execute_write (struct nfs_write_data *data) { -struct rpc_clnt *clnt =NFS_CLIENT (data->inode); -sigset_t oldset; - -rpc_clnt_sigmask (clnt, &oldset);rpc_execute (&data->task); -rpc_clnt_sigunmask (clnt, &oldset); }/*
include/linux/nfs_fs.h +1 -8
@@ -516,14 +516,7 @@ extern void * nfs_root_data(void);#define nfs_wait_event (clnt, wq, condition) \ ({ \ - int __retval = 0; \ - if (clnt->cl_intr) { \ - sigset_t oldmask; \ - rpc_clnt_sigmask(clnt, &oldmask); \ - __retval = wait_event_interruptible(wq, condition); \ - rpc_clnt_sigunmask(clnt, &oldmask); \ - } else \ - wait_event(wq, condition); \ + int __retval = wait_event_killable(wq, condition); \ __retval; \ })
include/linux/nfs_mount.h +1 -1
@@ -48,7 +48,7 @@ struct nfs_mount_data {/* bits in the flags field */ #define NFS_MOUNT_SOFT 0x0001/* 1 */ -#define NFS_MOUNT_INTR 0x0002/* 1 */ +#define NFS_MOUNT_INTR 0x0002/* 1 */ /* now unused, but ABI */ #define NFS_MOUNT_SECURE 0x0004/* 1 */ #define NFS_MOUNT_POSIX 0x0008/* 1 */ #define NFS_MOUNT_NOCTO 0x0010/* 1 */
include/linux/sunrpc/clnt.h +0 -2
@@ -41,7 +41,6 @@ struct rpc_clnt {struct rpc_iostats * cl_metrics;/* per-client statistics */ unsigned int cl_softrtry : 1,/* soft timeouts */ - cl_intr : 1,/* interruptible */ cl_discrtry : 1,/* disconnect before retry */ cl_autobind : 1;/* use getport() */
@@ -109,7 +108,6 @@ struct rpc_create_args {/* Values for "flags" field */ #define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) -#define RPC_CLNT_CREATE_INTR (1UL << 1)#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2)#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3)#define RPC_CLNT_CREATE_NOPING (1UL << 4)
include/linux/sunrpc/sched.h +0 -2
@@ -128,7 +128,6 @@ struct rpc_call_ops {#define RPC_TASK_DYNAMIC 0x0080/* task was kmalloc'ed */ #define RPC_TASK_KILLED 0x0100/* task was killed */ #define RPC_TASK_SOFT 0x0200/* Use soft timeouts */ -#define RPC_TASK_NOINTR 0x0400/* uninterruptible task */ #define RPC_IS_ASYNC (t) ((t)->tk_flags & RPC_TASK_ASYNC)#define RPC_IS_SWAPPER (t) ((t)->tk_flags & RPC_TASK_SWAPPER)
@@ -136,7 +135,6 @@ struct rpc_call_ops {#define RPC_ASSASSINATED (t) ((t)->tk_flags & RPC_TASK_KILLED)#define RPC_DO_CALLBACK (t) ((t)->tk_callback != NULL)#define RPC_IS_SOFT (t) ((t)->tk_flags & RPC_TASK_SOFT) -#define RPC_TASK_UNINTERRUPTIBLE (t) ((t)->tk_flags & RPC_TASK_NOINTR)#define RPC_TASK_RUNNING 0#define RPC_TASK_QUEUED 1
net/sunrpc/clnt.c +2 -45
89 lines not on this page · raw message
net/sunrpc/rpcb_clnt.c +1 -2
@@ -172,8 +172,7 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr, .program = &rpcb_program, .version = version, .authflavor = RPC_AUTH_UNIX, - .flags = (RPC_CLNT_CREATE_NOPING | - RPC_CLNT_CREATE_INTR), + .flags = RPC_CLNT_CREATE_NOPING, };switch (srvaddr->sa_family) {
net/sunrpc/sched.c +6 -9
@@ -245,9 +245,9 @@ void rpc_init_wait_queue(struct rpc_wait_queue *queue, const char *qname) }EXPORT_SYMBOL (rpc_init_wait_queue); -static int rpc_wait_bit_interruptible (void *word) +static int rpc_wait_bit_killable (void *word) { -if (signal_pending (current)) +if (fatal_signal_pending (current))return -ERESTARTSYS ;schedule ();return 0 ;
@@ -299,9 +299,9 @@ static void rpc_mark_complete_task(struct rpc_task *task)int __rpc_wait_for_completion_task (struct rpc_task *task,int (*action)(void *)) {if (action ==NULL ) - action = rpc_wait_bit_interruptible; + action = rpc_wait_bit_killable;return wait_on_bit (&task->tk_runstate,RPC_TASK_ACTIVE , - action,TASK_INTERRUPTIBLE ); + action,TASK_KILLABLE ); }EXPORT_SYMBOL (__rpc_wait_for_completion_task);
@@ -690,10 +690,9 @@ static void __rpc_execute(struct rpc_task *task)/* sync task: sleep here */ dprintk ("RPC: %5u sync task going to sleep\n" , task->tk_pid); -/* Note: Caller should be using rpc_clnt_sigmask() */ status =out_of_line_wait_on_bit (&task->tk_runstate, -RPC_TASK_QUEUED , rpc_wait_bit_interruptible, -TASK_INTERRUPTIBLE ); +RPC_TASK_QUEUED , rpc_wait_bit_killable, +TASK_KILLABLE );if (status == -ERESTARTSYS ) {/* * When a sync task receives a signal, it exits with
@@ -837,8 +836,6 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, int flags, conskref_get (&clnt->cl_kref);if (clnt->cl_softrtry) task->tk_flags |=RPC_TASK_SOFT ; -if (!clnt->cl_intr) - task->tk_flags |=RPC_TASK_NOINTR ; }BUG_ON (task->tk_ops ==NULL );
net/sunrpc/sunrpc_syms.c +0 -2
@@ -38,8 +38,6 @@ EXPORT_SYMBOL(rpc_killall_tasks);EXPORT_SYMBOL (rpc_call_sync);EXPORT_SYMBOL (rpc_call_async);EXPORT_SYMBOL (rpc_call_setup); -EXPORT_SYMBOL (rpc_clnt_sigmask); -EXPORT_SYMBOL (rpc_clnt_sigunmask);EXPORT_SYMBOL (rpc_delay);EXPORT_SYMBOL (rpc_restart_call);EXPORT_SYMBOL (rpc_setbufsize);
Signature · 18 lines
Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs _______________________________________________ Please note that [email protected] is being discontinued. Please subscribe to [email protected] instead. http://vger.kernel.org/vger-lists.html#linux-nfs