[CIFS] hold ses sem on tcp session reconnect during mount
authorSteve French <sfrench@us.ibm.com>
Thu, 3 Jan 2008 17:37:09 +0000 (17:37 +0000)
committerSteve French <sfrench@us.ibm.com>
Thu, 3 Jan 2008 17:37:09 +0000 (17:37 +0000)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/connect.c

index 658f58b99e6f5b1f00aaafb1c0b339fdb9698a97..db3746c891b58dc59098a465525eae3f3fbaf5b6 100644 (file)
@@ -1966,13 +1966,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                pSesInfo = existingCifsSes;
                cFYI(1, ("Existing smb sess found (status=%d)",
                        pSesInfo->status));
+               down(&pSesInfo->sesSem);
                if (pSesInfo->status == CifsNeedReconnect) {
                        cFYI(1, ("Session needs reconnect"));
-                       down(&pSesInfo->sesSem);
                        rc = cifs_setup_session(xid, pSesInfo,
                                                cifs_sb->local_nls);
-                       up(&pSesInfo->sesSem);
                }
+               up(&pSesInfo->sesSem);
        } else if (!rc) {
                cFYI(1, ("Existing smb sess not found"));
                pSesInfo = sesInfoAlloc();
@@ -3522,7 +3522,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb)
                sesInfoFree(ses);
 
        FreeXid(xid);
-       return rc;      /* BB check if we should always return zero here */
+       return rc;
 }
 
 int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,