]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: prevent infinite recursion in cifs_reconnect_tcon
authorJeff Layton <jlayton@redhat.com>
Wed, 29 Sep 2010 19:27:08 +0000 (15:27 -0400)
committerSteve French <sfrench@us.ibm.com>
Fri, 1 Oct 2010 17:50:08 +0000 (17:50 +0000)
commita16b3ce4cb30fb50c840bff0b4718990f874c0c4
tree4d7f7c32b9c89f15841bdbf372e75afe09bdef53
parent1252c7d468ddbcbfee4064e562df9ca5e2eb89f1
cifs: prevent infinite recursion in cifs_reconnect_tcon

cifs_reconnect_tcon is called from smb_init. After a successful
reconnect, cifs_reconnect_tcon will call reset_cifs_unix_caps. That
function will, in turn call CIFSSMBQFSUnixInfo and CIFSSMBSetFSUnixInfo.
Those functions also call smb_init.

It's possible for the session and tcon reconnect to succeed, and then
for another cifs_reconnect to occur before CIFSSMBQFSUnixInfo or
CIFSSMBSetFSUnixInfo to be called. That'll cause those functions to call
smb_init and cifs_reconnect_tcon again, ad infinitum...

Break the infinite recursion by having those functions use a new
smb_init variant that doesn't attempt to perform a reconnect.

Reported-and-Tested-by: Michal Suchanek <hramrach@centrum.cz>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifssmb.c