Clarify locking of cifs file and tcon structures and make more granular
authorSteve French <smfrench@gmail.com>
Thu, 22 Sep 2016 23:58:16 +0000 (18:58 -0500)
committerSteve French <smfrench@gmail.com>
Wed, 12 Oct 2016 17:08:32 +0000 (12:08 -0500)
commit3afca265b5f53a0b15b79531c13858049505582d
treeac9c7c97ee38fb4c156731643120833c5e53f63c
parentd171356ff11ab1825e456dfb979755e01b3c54a1
Clarify locking of cifs file and tcon structures and make more granular

Remove the global file_list_lock to simplify cifs/smb3 locking and
have spinlocks that more closely match the information they are
protecting.

Add new tcon->open_file_lock and file->file_info_lock spinlocks.
Locks continue to follow a heirachy,
cifs_socket --> cifs_ses --> cifs_tcon --> cifs_file
where global tcp_ses_lock still protects socket and cifs_ses, while the
the newer locks protect the lower level structure's information
(tcon and cifs_file respectively).

CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <steve.french@primarydata.com>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Germano Percossi <germano.percossi@citrix.com>
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/cifssmb.c
fs/cifs/file.c
fs/cifs/misc.c
fs/cifs/readdir.c
fs/cifs/smb2misc.c