cifs: ensure that we always do cifsFileInfo_get under the spinlock
authorJeff Layton <jlayton@redhat.com>
Wed, 25 Jul 2012 18:59:54 +0000 (14:59 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Aug 2012 15:22:54 +0000 (08:22 -0700)
commita130e9e48f95bbec9cb9b8ac3f938e552760fbf6
tree58c684729ce73beeb9ace1817634a91a4bb0a71d
parent6f51cd3bb2b88c2da4666ff9a6f3a8d9b04875ad
cifs: ensure that we always do cifsFileInfo_get under the spinlock

commit 764a1b1acecedfe204cb2e80d8e2cc7c6df1b0b8 upstream.

The readpages bug is a regression that was introduced in 6993f74a5.
This also fixes a couple of similar bugs in the uncached read and write
codepaths.

Also, prevent this sort of thing in the future by having cifsFileInfo_get
take the spinlock itself, and adding a _locked variant for use in places
that are already holding the lock. The _put code has always done that
so this makes for a less confusing interface.

Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifsglob.h
fs/cifs/file.c