From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Subject: Re: problem with kthread changes that went into cifs_demultiplex_thread Date: Tue, 10 Jun 2008 13:24:00 -0400 Message-ID: <20080610132400.4283b36d@tleilax.poochiereds.net> References: <524f69650806100841r4f90bd0k342c3264c8c64362@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel To: "Steve French" Return-path: Received: from mx1.redhat.com ([66.187.233.31]:60944 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755117AbYFJRYD (ORCPT ); Tue, 10 Jun 2008 13:24:03 -0400 In-Reply-To: <524f69650806100841r4f90bd0k342c3264c8c64362@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 10 Jun 2008 10:41:29 -0500 "Steve French" wrote: > In working on the smb2 client implementation, I noticed that there is > a problem with the revised kthread logic which takes down cifsd > (cifs_demultiplex_thread) on umount or on abnormal socket termination > during protocol negotiation. I noticed this while looking at SMB2 > since the Samba 4 SMB2 server was not handling the new SMB2 Negotiate > protocol request (and unlike Windows Server 2008) and was closing the > tcp session immediately after receiving the negprot request from the > client. An unexpected error on negprot which causes the TCP session > to close will cause cifsd to exit, but now this blocks forever at > kthread_should_stop just after the main loop in > cifs_demultiplex_thread. Ok, I think I see what you're talking about. *sigh* -- and I just posted the patch to make the kthread go to sleep to our internal mailing lists this morning. > The task doing mount is blocked in > wait_event on the response_q but will never be woken up by cifsd (even > though it would timeout if some one did wake it up once the 15 second > timeout was expired). umount will never call kthread_stop because > mount never succeeded - we do not have a tree connection yet (so tcon > is null and we can't get to tcon->ses->server) and the failed mount > won't call kthread_stop because it is stuck in wait_event with no one > to wake up response_q. > > Adding a call to wake_up_all(&server->response_q) right after we set > server->tcpStatus = CifsExiting at the end of the loop in > cifs_demultiplex_thread but before we wait for kthread_stop works in > my testing. > The solution sounds reasonable at first glance. Will you be pushing a patch to your git tree for this soon? Thanks, -- Jeff Layton