aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2014-09-16 05:16:19 -0400
committerSteve French <smfrench@gmail.com>2014-09-16 06:26:24 -0400
commita5c3e1c725af9e84deceb3c33939ca4ffe3fefc8 (patch)
treeedeb2ba856b15fcd34dfdcbed07e6d2dcf2824f1 /fs
parentda80659d4aa758dc6935b10ec64513f0b67bc969 (diff)
Revert "cifs: No need to send SIGKILL to demux_thread during umount"
This reverts commit 52a36244443eabb594bdb63622ff2dd7a083f0e2. Causes rmmod to fail for at least 7 seconds after unmount which makes automated testing a little harder when reloading cifs.ko between test runs. Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> CC: Jeff Layton <jlayton@primarydata.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8a9fded7c135..36ca2045009b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -837,6 +837,7 @@ cifs_demultiplex_thread(void *p)
837 struct TCP_Server_Info *server = p; 837 struct TCP_Server_Info *server = p;
838 unsigned int pdu_length; 838 unsigned int pdu_length;
839 char *buf = NULL; 839 char *buf = NULL;
840 struct task_struct *task_to_wake = NULL;
840 struct mid_q_entry *mid_entry; 841 struct mid_q_entry *mid_entry;
841 842
842 current->flags |= PF_MEMALLOC; 843 current->flags |= PF_MEMALLOC;
@@ -927,7 +928,19 @@ cifs_demultiplex_thread(void *p)
927 if (server->smallbuf) /* no sense logging a debug message if NULL */ 928 if (server->smallbuf) /* no sense logging a debug message if NULL */
928 cifs_small_buf_release(server->smallbuf); 929 cifs_small_buf_release(server->smallbuf);
929 930
931 task_to_wake = xchg(&server->tsk, NULL);
930 clean_demultiplex_info(server); 932 clean_demultiplex_info(server);
933
934 /* if server->tsk was NULL then wait for a signal before exiting */
935 if (!task_to_wake) {
936 set_current_state(TASK_INTERRUPTIBLE);
937 while (!signal_pending(current)) {
938 schedule();
939 set_current_state(TASK_INTERRUPTIBLE);
940 }
941 set_current_state(TASK_RUNNING);
942 }
943
931 module_put_and_exit(0); 944 module_put_and_exit(0);
932} 945}
933 946
@@ -2050,6 +2063,8 @@ cifs_find_tcp_session(struct smb_vol *vol)
2050static void 2063static void
2051cifs_put_tcp_session(struct TCP_Server_Info *server) 2064cifs_put_tcp_session(struct TCP_Server_Info *server)
2052{ 2065{
2066 struct task_struct *task;
2067
2053 spin_lock(&cifs_tcp_ses_lock); 2068 spin_lock(&cifs_tcp_ses_lock);
2054 if (--server->srv_count > 0) { 2069 if (--server->srv_count > 0) {
2055 spin_unlock(&cifs_tcp_ses_lock); 2070 spin_unlock(&cifs_tcp_ses_lock);
@@ -2073,6 +2088,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)
2073 kfree(server->session_key.response); 2088 kfree(server->session_key.response);
2074 server->session_key.response = NULL; 2089 server->session_key.response = NULL;
2075 server->session_key.len = 0; 2090 server->session_key.len = 0;
2091
2092 task = xchg(&server->tsk, NULL);
2093 if (task)
2094 force_sig(SIGKILL, task);
2076} 2095}
2077 2096
2078static struct TCP_Server_Info * 2097static struct TCP_Server_Info *