Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231972
b: refs/heads/master
c: 9d78315
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed Jan 19, 2011
1 parent 547bf32 commit f723903
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 42 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: 941b853d779de3298e39f1eb4e252984464eaea8
refs/heads/master: 9d78315b03fc91228306db42edc533efa69cb518
44 changes: 3 additions & 41 deletions trunk/fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
struct kvec iov;
struct socket *csocket = server->ssocket;
struct list_head *tmp;
struct cifsSesInfo *ses;
struct task_struct *task_to_wake = NULL;
struct mid_q_entry *mid_entry;
char temp;
Expand Down Expand Up @@ -677,44 +676,19 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
if (smallbuf) /* no sense logging a debug message if NULL */
cifs_small_buf_release(smallbuf);

/*
* BB: we shouldn't have to do any of this. It shouldn't be
* possible to exit from the thread with active SMB sessions
*/
spin_lock(&cifs_tcp_ses_lock);
if (list_empty(&server->pending_mid_q)) {
/* loop through server session structures attached to this and
mark them dead */
list_for_each(tmp, &server->smb_ses_list) {
ses = list_entry(tmp, struct cifsSesInfo,
smb_ses_list);
ses->status = CifsExiting;
ses->server = NULL;
}
spin_unlock(&cifs_tcp_ses_lock);
} else {
/* although we can not zero the server struct pointer yet,
since there are active requests which may depnd on them,
mark the corresponding SMB sessions as exiting too */
list_for_each(tmp, &server->smb_ses_list) {
ses = list_entry(tmp, struct cifsSesInfo,
smb_ses_list);
ses->status = CifsExiting;
}

if (!list_empty(&server->pending_mid_q)) {
spin_lock(&GlobalMid_Lock);
list_for_each(tmp, &server->pending_mid_q) {
mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
if (mid_entry->midState == MID_REQUEST_SUBMITTED) {
cFYI(1, "Clearing Mid 0x%x - waking up ",
mid_entry->mid);
mid_entry->mid);
task_to_wake = mid_entry->tsk;
if (task_to_wake)
wake_up_process(task_to_wake);
}
}
spin_unlock(&GlobalMid_Lock);
spin_unlock(&cifs_tcp_ses_lock);
/* 1/8th of sec is more than enough time for them to exit */
msleep(125);
}
Expand All @@ -732,18 +706,6 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
coming home not much else we can do but free the memory */
}

/* last chance to mark ses pointers invalid
if there are any pointing to this (e.g
if a crazy root user tried to kill cifsd
kernel thread explicitly this might happen) */
/* BB: This shouldn't be necessary, see above */
spin_lock(&cifs_tcp_ses_lock);
list_for_each(tmp, &server->smb_ses_list) {
ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);
ses->server = NULL;
}
spin_unlock(&cifs_tcp_ses_lock);

kfree(server->hostname);
task_to_wake = xchg(&server->tsk, NULL);
kfree(server);
Expand Down

0 comments on commit f723903

Please sign in to comment.