Commit e3e64e26 authored by Konstantin Baev's avatar Konstantin Baev

Update sources 2.6.27 - 2.6.28

Refactoring code, which solved kmem_cache_destroy problem
parent 43e50e37
......@@ -176,7 +176,7 @@ struct TCP_Server_Info {
struct mac_key mac_signing_key;
char ntlmv2_hash[16];
unsigned long lstrp; /* when we got last response from this server */
int running;
struct completion done;
};
/*
......
......@@ -348,7 +348,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
bool isMultiRsp;
int reconnect;
server->running = 1;
init_completion(&server->done);
current->flags |= PF_MEMALLOC;
cFYI(1, ("Demultiplex PID: %d", task_pid_nr(current)));
......@@ -760,9 +760,6 @@ multi_t2_fnd:
kfree(server->hostname);
task_to_wake = xchg(&server->tsk, NULL);
server->running = 0;
msleep(20);
kfree(server);
length = atomic_dec_return(&tcpSesAllocCount);
if (length > 0)
......@@ -779,6 +776,8 @@ multi_t2_fnd:
set_current_state(TASK_RUNNING);
}
complete_all(&server->done);
return 0;
}
......@@ -1424,8 +1423,9 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)
if (task)
force_sig(SIGKILL, task);
while(server->running == 1)
msleep(10);
wait_for_completion_interruptible(&server->done);
kfree(server);
}
static struct cifsSesInfo *
......
......@@ -176,7 +176,7 @@ struct TCP_Server_Info {
struct mac_key mac_signing_key;
char ntlmv2_hash[16];
unsigned long lstrp; /* when we got last response from this server */
int running;
struct completion done;
};
/*
......
......@@ -350,7 +350,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
bool isMultiRsp;
int reconnect;
server->running = 1;
init_completion(&server->done);
current->flags |= PF_MEMALLOC;
cFYI(1, ("Demultiplex PID: %d", task_pid_nr(current)));
......@@ -761,9 +761,6 @@ multi_t2_fnd:
kfree(server->hostname);
task_to_wake = xchg(&server->tsk, NULL);
server->running = 0;
msleep(20);
kfree(server);
length = atomic_dec_return(&tcpSesAllocCount);
if (length > 0)
......@@ -780,6 +777,8 @@ multi_t2_fnd:
set_current_state(TASK_RUNNING);
}
complete_all(&server->done);
return 0;
}
......@@ -1431,8 +1430,9 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)
if (task)
force_sig(SIGKILL, task);
while(server->running == 1)
msleep(10);
wait_for_completion_interruptible(&server->done);
kfree(server);
}
static struct cifsSesInfo *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment