Re: 2.6.22-rc1-mm1 cifs_mount oops



This can end up running kthread_stop() against an already-exited task.
I don't think so since cifs_demultiplex_thread waits sufficiently long
before
exit but after setting srvTcp->tsk to zero (the wait is immediately after
waking up any processes that may be blocked on requests on this socket to
give
file requests time to exit from the cifs vfs). As long as this (mount)
process were
scheduled within 1.25 seconds it should be ok although more complicated
than I
would like (that is why this thread was the last one in cifs to switch
to kthread API).

I wish there were an obvious way to do this, perhaps without using
kthread_stop at all
for this thread (since that by itself does not seem to work for threads
blocked
in various socket calls).


--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2069,8 +2069,12 @@ cifs_mount(struct super_block *sb, struct
cifs_sb_info *cifs_sb,
srvTcp->tcpStatus =
CifsExiting;
spin_unlock(&GlobalMid_Lock);
if (srvTcp->tsk) {
struct
task_struct *tsk;
send_sig(SIGKILL,srvTcp->tsk,1);
- kthread_stop(srvTcp->tsk);
+ /*
srvTcp->tsk can be zeroed at any time */
+ tsk =
srvTcp->tsk;
+ if (tsk)
+ kthread_stop(tsk);
}


I don't think so


Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [9fans] APE and listen(2B)
    ... seems to somehow exit the actual listenproc, ... socket accept: Invalid argument ... int main { ... perror; ...
    (comp.os.plan9)
  • Re: error handling
    ... >> Lisa Pearlson wrote: ... >>> Imagine I have a socket read function.. ... >>> exit 1 ... > exceptions to return data yet allow additional info.. ...
    (comp.lang.tcl)
  • Re: Dangers of intercepting SIGINT?
    ... I used signalto interceptSIGINT. ... it must close it's socket and exit. ... The server process prints various ...
    (comp.os.linux.development.apps)
  • Re: CAtlHttpClient Navigate()
    ... TCPWaitedTimeDelay registry setting parameter to control the number of ... of 4000 sockets and that was the point when we started seeing the Socket ... I suggest that the problem isn't in CAtlHttpClient, but more likely in the way your test harness is designed. ... After about 4000 requests we start getting a "WSAEADDRINUSE" ...
    (microsoft.public.vc.atl)
  • Re: closesocket
    ... the Wait is called in the application exit code. ... > thread since my app uses blocking socket. ... > calls closesocket and WSACleanup without waiting for the thread to ...
    (microsoft.public.windowsce.embedded.vc)