diff -ur linux-2.6.9/fs/cifs/connect.c linux-2.6.9-fix/fs/cifs/connect.c --- linux-2.6.9/fs/cifs/connect.c 2007-09-26 11:54:19.000000000 +0200 +++ linux-2.6.9-fix/fs/cifs/connect.c 2007-09-26 11:58:51.000000000 +0200 @@ -1831,6 +1831,16 @@ cFYI(1, ("Existing smb sess found")); kfree(volume_info.password); /* volume_info.UNC freed at end of function */ + + /* need to prevent multiple threads trying to + simultaneously reconnect the same SMB session */ + down(&pSesInfo->sesSem); + if(pSesInfo->status == CifsNeedReconnect) { + rc = cifs_setup_session(0, pSesInfo, + cifs_sb->local_nls); + } + up(&pSesInfo->sesSem); + } else if (!rc) { cFYI(1, ("Existing smb sess not found")); pSesInfo = sesInfoAlloc();