nfs: Panic when commit fails
authorTerry Loftin <terry.loftin@hp.com>
Fri, 23 Oct 2009 01:36:01 +0000 (21:36 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:52:32 +0000 (16:52 -0800)
commit8107fe51452d9213d5442a368ce710681b0c88c9
treec2373410145f839df873c9b06f03d661d12a3a66
parentd4f9442f8805df2d235b446e3e7fe53f2f3d232e
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>
fs/nfs/direct.c