Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184939
b: refs/heads/master
c: d7b619c
h: refs/heads/master
i:
  184937: ca431f5
  184935: acf1276
v: v3
  • Loading branch information
Steve French committed Feb 25, 2010
1 parent 07cdf1e commit 6f016c3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 122ca0076e5f84fa12943f22f6586ff285670783
refs/heads/master: d7b619cf56218704ffce9d510aa497f0a0bcda0b
2 changes: 1 addition & 1 deletion trunk/fs/cifs/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ struct cifsUidInfo {
struct cifsSesInfo {
struct list_head smb_ses_list;
struct list_head tcon_list;
struct semaphore sesSem;
struct mutex session_mutex;
#if 0
struct cifsUidInfo *uidInfo; /* pointer to user info */
#endif
Expand Down
12 changes: 6 additions & 6 deletions trunk/fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,19 @@ cifs_reconnect_tcon(struct cifsTconInfo *tcon, int smb_command)
* need to prevent multiple threads trying to simultaneously
* reconnect the same SMB session
*/
down(&ses->sesSem);
mutex_lock(&ses->session_mutex);
if (ses->need_reconnect)
rc = cifs_setup_session(0, ses, nls_codepage);

/* do we need to reconnect tcon? */
if (rc || !tcon->need_reconnect) {
up(&ses->sesSem);
mutex_unlock(&ses->session_mutex);
goto out;
}

mark_open_files_invalid(tcon);
rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage);
up(&ses->sesSem);
mutex_unlock(&ses->session_mutex);
cFYI(1, ("reconnect tcon rc = %d", rc));

if (rc)
Expand Down Expand Up @@ -700,13 +700,13 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
if (!ses || !ses->server)
return -EIO;

down(&ses->sesSem);
mutex_lock(&ses->session_mutex);
if (ses->need_reconnect)
goto session_already_dead; /* no need to send SMBlogoff if uid
already closed due to reconnect */
rc = small_smb_init(SMB_COM_LOGOFF_ANDX, 2, NULL, (void **)&pSMB);
if (rc) {
up(&ses->sesSem);
mutex_unlock(&ses->session_mutex);
return rc;
}

Expand All @@ -721,7 +721,7 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
pSMB->AndXCommand = 0xFF;
rc = SendReceiveNoRsp(xid, ses, (struct smb_hdr *) pSMB, 0);
session_already_dead:
up(&ses->sesSem);
mutex_unlock(&ses->session_mutex);

/* if session dead then we do not need to do ulogoff,
since server closed smb session, no sense reporting
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -2388,13 +2388,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
*/
cifs_put_tcp_session(srvTcp);

down(&pSesInfo->sesSem);
mutex_lock(&pSesInfo->session_mutex);
if (pSesInfo->need_reconnect) {
cFYI(1, ("Session needs reconnect"));
rc = cifs_setup_session(xid, pSesInfo,
cifs_sb->local_nls);
}
up(&pSesInfo->sesSem);
mutex_unlock(&pSesInfo->session_mutex);
} else if (!rc) {
cFYI(1, ("Existing smb sess not found"));
pSesInfo = sesInfoAlloc();
Expand Down Expand Up @@ -2437,12 +2437,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
}
pSesInfo->linux_uid = volume_info->linux_uid;
pSesInfo->overrideSecFlg = volume_info->secFlg;
down(&pSesInfo->sesSem);
mutex_lock(&pSesInfo->session_mutex);

/* BB FIXME need to pass vol->secFlgs BB */
rc = cifs_setup_session(xid, pSesInfo,
cifs_sb->local_nls);
up(&pSesInfo->sesSem);
mutex_unlock(&pSesInfo->session_mutex);
}

/* search for existing tcon to this server share */
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/cifs/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sesInfoAlloc(void)
++ret_buf->ses_count;
INIT_LIST_HEAD(&ret_buf->smb_ses_list);
INIT_LIST_HEAD(&ret_buf->tcon_list);
init_MUTEX(&ret_buf->sesSem);
mutex_init(&ret_buf->session_mutex);
}
return ret_buf;
}
Expand Down

0 comments on commit 6f016c3

Please sign in to comment.