Commit 201f92e2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  SUNRPC: Fix use of static variable in rpcb_getport_async
  NFSv4.1: update nfs4_fattr_bitmap_maxsz
  SUNRPC: Fix a race between work-queue and rpc_killall_tasks
  pnfs: write: Set mds_offset in the generic layer - it is needed by all LDs
parents 6ac556da ec0dd267
...@@ -398,7 +398,6 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync) ...@@ -398,7 +398,6 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync)
* this offset and save the original offset. * this offset and save the original offset.
*/ */
data->args.offset = filelayout_get_dserver_offset(lseg, offset); data->args.offset = filelayout_get_dserver_offset(lseg, offset);
data->mds_offset = offset;
/* Perform an asynchronous write */ /* Perform an asynchronous write */
status = nfs_initiate_write(data, ds->ds_clp->cl_rpcclient, status = nfs_initiate_write(data, ds->ds_clp->cl_rpcclient,
......
...@@ -91,7 +91,7 @@ static int nfs4_stat_to_errno(int); ...@@ -91,7 +91,7 @@ static int nfs4_stat_to_errno(int);
#define encode_getfh_maxsz (op_encode_hdr_maxsz) #define encode_getfh_maxsz (op_encode_hdr_maxsz)
#define decode_getfh_maxsz (op_decode_hdr_maxsz + 1 + \ #define decode_getfh_maxsz (op_decode_hdr_maxsz + 1 + \
((3+NFS4_FHSIZE) >> 2)) ((3+NFS4_FHSIZE) >> 2))
#define nfs4_fattr_bitmap_maxsz 3 #define nfs4_fattr_bitmap_maxsz 4
#define encode_getattr_maxsz (op_encode_hdr_maxsz + nfs4_fattr_bitmap_maxsz) #define encode_getattr_maxsz (op_encode_hdr_maxsz + nfs4_fattr_bitmap_maxsz)
#define nfs4_name_maxsz (1 + ((3 + NFS4_MAXNAMLEN) >> 2)) #define nfs4_name_maxsz (1 + ((3 + NFS4_MAXNAMLEN) >> 2))
#define nfs4_path_maxsz (1 + ((3 + NFS4_MAXPATHLEN) >> 2)) #define nfs4_path_maxsz (1 + ((3 + NFS4_MAXPATHLEN) >> 2))
......
...@@ -864,6 +864,8 @@ static int nfs_write_rpcsetup(struct nfs_page *req, ...@@ -864,6 +864,8 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
data->args.fh = NFS_FH(inode); data->args.fh = NFS_FH(inode);
data->args.offset = req_offset(req) + offset; data->args.offset = req_offset(req) + offset;
/* pnfs_set_layoutcommit needs this */
data->mds_offset = data->args.offset;
data->args.pgbase = req->wb_pgbase + offset; data->args.pgbase = req->wb_pgbase + offset;
data->args.pages = data->pagevec; data->args.pages = data->pagevec;
data->args.count = count; data->args.count = count;
......
...@@ -597,7 +597,7 @@ void rpcb_getport_async(struct rpc_task *task) ...@@ -597,7 +597,7 @@ void rpcb_getport_async(struct rpc_task *task)
u32 bind_version; u32 bind_version;
struct rpc_xprt *xprt; struct rpc_xprt *xprt;
struct rpc_clnt *rpcb_clnt; struct rpc_clnt *rpcb_clnt;
static struct rpcbind_args *map; struct rpcbind_args *map;
struct rpc_task *child; struct rpc_task *child;
struct sockaddr_storage addr; struct sockaddr_storage addr;
struct sockaddr *sap = (struct sockaddr *)&addr; struct sockaddr *sap = (struct sockaddr *)&addr;
......
...@@ -616,30 +616,25 @@ static void __rpc_execute(struct rpc_task *task) ...@@ -616,30 +616,25 @@ static void __rpc_execute(struct rpc_task *task)
BUG_ON(RPC_IS_QUEUED(task)); BUG_ON(RPC_IS_QUEUED(task));
for (;;) { for (;;) {
void (*do_action)(struct rpc_task *);
/* /*
* Execute any pending callback. * Execute any pending callback first.
*/ */
if (task->tk_callback) { do_action = task->tk_callback;
void (*save_callback)(struct rpc_task *); task->tk_callback = NULL;
if (do_action == NULL) {
/*
* We set tk_callback to NULL before calling it,
* in case it sets the tk_callback field itself:
*/
save_callback = task->tk_callback;
task->tk_callback = NULL;
save_callback(task);
} else {
/* /*
* Perform the next FSM step. * Perform the next FSM step.
* tk_action may be NULL when the task has been killed * tk_action may be NULL if the task has been killed.
* by someone else. * In particular, note that rpc_killall_tasks may
* do this at any time, so beware when dereferencing.
*/ */
if (task->tk_action == NULL) do_action = task->tk_action;
if (do_action == NULL)
break; break;
task->tk_action(task);
} }
do_action(task);
/* /*
* Lockless check for whether task is sleeping or not. * Lockless check for whether task is sleeping or not.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment