diff options
author | Terry Loftin <terry.loftin@hp.com> | 2009-10-22 21:36:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-11-09 16:23:00 -0800 |
commit | 2169536c156b6bc876c0a80e5cf98319cc3b9aab (patch) | |
tree | 240768cb4e55ba58c9ab6fd97b8b14476405688c | |
parent | 55a6efb39afcfe70754a733cdca91b6e1599fb6b (diff) | |
download | lwn-2169536c156b6bc876c0a80e5cf98319cc3b9aab.tar.gz lwn-2169536c156b6bc876c0a80e5cf98319cc3b9aab.zip |
nfs: Panic when commit fails
commit a8b40bc7e635831b61c43acc71a86d3a68b2dff0 upstream.
Actually pass the NFS_FILE_SYNC option to the server to avoid a
Panic in nfs_direct_write_complete() when a commit fails.
At the end of an nfs write, if the nfs commit fails, all the writes
will be rescheduled. They are supposed to be rescheduled as NFS_FILE_SYNC
writes, but the rpc_task structure is not completely intialized and so
the option is not passed. When the rescheduled writes complete, the
return indicates that they are NFS_UNSTABLE and we try to do another
commit. This leads to a Panic because the commit data structure pointer
was set to null in the initial (failed) commit attempt.
Signed-off-by: Terry Loftin <terry.loftin@hp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | fs/nfs/direct.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index e4e089a8f294..1af78ffbe337 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -457,6 +457,7 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) }; struct rpc_task_setup task_setup_data = { .rpc_client = NFS_CLIENT(inode), + .rpc_message = &msg, .callback_ops = &nfs_write_direct_ops, .workqueue = nfsiod_workqueue, .flags = RPC_TASK_ASYNC, |