cifs: fix handling of signing with writepages (try #6)
authorJeff Layton <jlayton@redhat.com>
Wed, 22 Sep 2010 23:17:40 +0000 (16:17 -0700)
committerSteve French <sfrench@us.ibm.com>
Wed, 29 Sep 2010 19:04:33 +0000 (19:04 +0000)
commitf3983c2133e9bea9c8b4f690737d15e3e9b02491
tree89cc00b209368a41e5554ac1be103ef6e79d8fe1
parentf7a40689fd1e963cb1006349e050c07584895db5
cifs: fix handling of signing with writepages (try #6)

Get a reference to the file early so we can eventually base the decision
about signing on the correct tcon. If that doesn't work for some reason,
then fall back to generic_writepages. That's just as likely to fail, but
it simplifies the error handling.

In truth, I'm not sure how that could occur anyway, so maybe a NULL
open_file here ought to be a BUG()?

After that, we drop the reference to the open_file and then we re-get
one prior to each WriteAndX call. This helps ensure that the filehandle
isn't held open any longer than necessary and that open files are
reclaimed prior to each write call.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/file.c