]> git.neil.brown.name Git - history.git/commitdiff
RPC,NFSv4: NFSv4 operations that create or destroy state on the
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Mon, 23 Aug 2004 16:02:36 +0000 (12:02 -0400)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Mon, 23 Aug 2004 16:02:36 +0000 (12:02 -0400)
   server are not allowed to be interrupted as that may result in the
   client and server disagreeing.

fs/nfs/nfs4proc.c
include/linux/sunrpc/sched.h
net/sunrpc/sched.c

index c95512eec50e035f16547662e551052f66460b39..237623f3485c8496660e7b7aaf8834616ff3e145 100644 (file)
@@ -227,7 +227,7 @@ static int _nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *st
                }
                o_arg.u.delegation_type = delegation->type;
        }
-       status = rpc_call_sync(server->client, &msg, 0);
+       status = rpc_call_sync(server->client, &msg, RPC_TASK_NOINTR);
        nfs4_increment_seqid(status, sp);
        if (status == 0) {
                memcpy(&state->stateid, &o_res.stateid, sizeof(state->stateid));
@@ -297,7 +297,7 @@ static int _nfs4_open_delegation_recall(struct dentry *dentry, struct nfs4_state
        arg.seqid = sp->so_seqid;
        arg.open_flags = state->state;
        memcpy(arg.u.delegation.data, state->stateid.data, sizeof(arg.u.delegation.data));
-       status = rpc_call_sync(server->client, &msg, 0);
+       status = rpc_call_sync(server->client, &msg, RPC_TASK_NOINTR);
        nfs4_increment_seqid(status, sp);
        if (status >= 0) {
                memcpy(state->stateid.data, res.stateid.data,
@@ -348,7 +348,7 @@ static int _nfs4_proc_open_confirm(struct rpc_clnt *clnt, const struct nfs_fh *f
        };
        int status;
 
-       status = rpc_call_sync(clnt, &msg, 0);
+       status = rpc_call_sync(clnt, &msg, RPC_TASK_NOINTR);
        nfs4_increment_seqid(status, sp);
        if (status >= 0)
                memcpy(stateid, &res.stateid, sizeof(*stateid));
@@ -526,7 +526,7 @@ static int _nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct
        o_arg.id = sp->so_id;
        o_arg.clientid = clp->cl_clientid,
 
-       status = rpc_call_sync(server->client, &msg, 0);
+       status = rpc_call_sync(server->client, &msg, RPC_TASK_NOINTR);
        nfs4_increment_seqid(status, sp);
        if (status)
                goto out_err;
@@ -688,7 +688,7 @@ static int _nfs4_do_close(struct inode *inode, struct nfs4_state *state)
        memcpy(&arg.stateid, &state->stateid, sizeof(arg.stateid));
        /* Serialization for the sequence id */
        arg.seqid = sp->so_seqid,
-       status = rpc_call_sync(NFS_SERVER(inode)->client, &msg, 0);
+       status = rpc_call_sync(NFS_SERVER(inode)->client, &msg, RPC_TASK_NOINTR);
 
         /* hmm. we are done with the inode, and in the process of freeing
         * the state_owner. we keep this around to process errors
@@ -739,7 +739,7 @@ static int _nfs4_do_downgrade(struct inode *inode, struct nfs4_state *state, mod
        if (test_bit(NFS_DELEGATED_STATE, &state->flags))
                return 0;
        memcpy(&arg.stateid, &state->stateid, sizeof(arg.stateid));
-       status = rpc_call_sync(NFS_SERVER(inode)->client, &msg, 0);
+       status = rpc_call_sync(NFS_SERVER(inode)->client, &msg, RPC_TASK_NOINTR);
        nfs4_increment_seqid(status, sp);
        if (!status)
                memcpy(&state->stateid, &res.stateid, sizeof(state->stateid));
@@ -2403,7 +2403,7 @@ static int _nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock
                luargs.seqid = lsp->ls_seqid;
                memcpy(&luargs.stateid, &lsp->ls_stateid, sizeof(luargs.stateid));
                arg.u.locku = &luargs;
-               status = rpc_call_sync(server->client, &msg, 0);
+               status = rpc_call_sync(server->client, &msg, RPC_TASK_NOINTR);
                nfs4_increment_lock_seqid(status, lsp);
        }
 
@@ -2479,7 +2479,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *r
                arg.u.lock = &largs;
                down(&owner->so_sema);
                otl.open_seqid = owner->so_seqid;
-               status = rpc_call_sync(server->client, &msg, 0);
+               status = rpc_call_sync(server->client, &msg, RPC_TASK_NOINTR);
                /* increment open_owner seqid on success, and 
                * seqid mutating errors */
                nfs4_increment_seqid(status, owner);
@@ -2492,7 +2492,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *r
                largs.u.exist_lock = &el;
                largs.new_lock_owner = 0;
                arg.u.lock = &largs;
-               status = rpc_call_sync(server->client, &msg, 0);
+               status = rpc_call_sync(server->client, &msg, RPC_TASK_NOINTR);
        }
        /* increment seqid on success, and * seqid mutating errors*/
        nfs4_increment_lock_seqid(status, lsp);
index be2e6ef3b79376c9f7153f2ed475c41c28d8e477..6959ed0d69d80cd80166ac252200462de9aff813 100644 (file)
@@ -113,6 +113,7 @@ typedef void                        (*rpc_action)(struct rpc_task *);
 #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_SETUID(t)       ((t)->tk_flags & RPC_TASK_SETUID)
@@ -123,6 +124,7 @@ typedef void                        (*rpc_action)(struct rpc_task *);
 #define RPC_IS_ACTIVATED(t)    ((t)->tk_active)
 #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_SLEEPING      0
 #define RPC_TASK_RUNNING       1
index ae45a763a09d1920e17f295957138510ef1b4a5f..aa2205a2c19a1a666299b148ca9ea0545ca64e22 100644 (file)
@@ -698,7 +698,7 @@ __rpc_execute(struct rpc_task *task)
                if (current->pid == rpciod_pid)
                        printk(KERN_ERR "RPC: rpciod waiting on sync task!\n");
 
-               if (!task->tk_client->cl_intr) {
+               if (RPC_TASK_UNINTERRUPTIBLE(task)) {
                        __wait_event(task->tk_wait, !RPC_IS_SLEEPING(task));
                } else {
                        __wait_event_interruptible(task->tk_wait, !RPC_IS_SLEEPING(task), status);
@@ -884,6 +884,8 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, rpc_action call
                atomic_inc(&clnt->cl_users);
                if (clnt->cl_softrtry)
                        task->tk_flags |= RPC_TASK_SOFT;
+               if (!clnt->cl_intr)
+                       task->tk_flags |= RPC_TASK_NOINTR;
        }
 
 #ifdef RPC_DEBUG