Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 309854 Details for
Bug 444865
oops in cifs module while trying to stop a thread (kthread_stop) during filesystem mount
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
updated patch
20-bz-444865-cifs-don-t-allow-dem.patch (text/plain), 3.92 KB, created by
Jeff Layton
on 2008-06-19 15:29:18 UTC
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-06-19 15:29:18 UTC
Size:
3.92 KB
patch
obsolete
>BZ#444865: [CIFS] don't allow demultiplex thread to exit until kthread_stop is called > >From: Jeff Layton <jlayton@redhat.com> > >cifs_demultiplex_thread can exit under several conditions: > >1) if it's signaled >2) if there's a problem with session setup >3) if kthread_stop is called on it > >The first two are problems. If kthread_stop is called on the thread, >there is no guarantee that it will still be up. We need to have the >thread stay up until kthread_stop is called on it. > >One option would be to not even try to tear things down until after >kthread_stop is called. However, in the case where there is a problem >setting up the session, there's no real reason to try continuing the >loop. > >This patch allows the thread to continue to exit its main loop under all >three conditions, but it has the thread go to sleep until kthread_stop >is called. This allows us to simplify the shutdown code somewhat since >we can be reasonably sure that the thread won't exit after being >signaled but before kthread_stop is called. > >It also removes the places where the thread itself set the tsk variable >since it appeared that it could have a potential race where the thread >might never be shut down. >--- > > fs/cifs/connect.c | 31 ++++++++++++++++--------------- > 1 files changed, 16 insertions(+), 15 deletions(-) > > >diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c >index f6ffdf1..a41dc02 100644 >--- a/fs/cifs/connect.c >+++ b/fs/cifs/connect.c >@@ -375,7 +375,6 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) > #endif > > current->flags |= PF_MEMALLOC; >- server->tsk = current; /* save process info to wake at shutdown */ > cFYI(1, ("Demultiplex PID: %d", current->pid)); > write_lock(&GlobalSMBSeslock); > atomic_inc(&tcpSesAllocCount); >@@ -701,14 +700,25 @@ multi_t2_fnd: > #endif /* CIFS_DEBUG2 */ > > } >- } /* end while !EXITING */ >+ } /* end while !kthread_should_stop() */ > > spin_lock(&GlobalMid_Lock); > server->tcpStatus = CifsExiting; >- server->tsk = NULL; >+ spin_unlock(&GlobalMid_Lock); >+ wake_up_all(&server->response_q); >+ >+ /* don't exit until kthread_stop is called */ >+ set_current_state(TASK_UNINTERRUPTIBLE); >+ while (!kthread_should_stop()) { >+ schedule(); >+ set_current_state(TASK_UNINTERRUPTIBLE); >+ } >+ set_current_state(TASK_RUNNING); >+ > /* check if we have blocked requests that need to free */ > /* Note that cifs_max_pending is normally 50, but > can be set at module install time to as little as two */ >+ spin_lock(&GlobalMid_Lock); > if (atomic_read(&server->inFlight) >= cifs_max_pending) > atomic_set(&server->inFlight, cifs_max_pending - 1); > /* We do not want to set the max_pending too low or we >@@ -2268,15 +2278,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; > /* If we could verify that kthread_stop would > always wake up processes blocked in > tcp in recv_mesg then we could remove the > send_sig call */ > force_sig(SIGKILL, srvTcp->tsk); >- tsk = srvTcp->tsk; >- if (tsk) >- kthread_stop(tsk); >+ kthread_stop(srvTcp->tsk); > } > } > /* If find_unc succeeded then rc == 0 so we can not end */ >@@ -2292,23 +2299,17 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, > if ((temp_rc == -ESHUTDOWN) && > (pSesInfo->server) && > (pSesInfo->server->tsk)) { >- struct task_struct *tsk; > force_sig(SIGKILL, > pSesInfo->server->tsk); >- tsk = pSesInfo->server->tsk; >- if (tsk) >- kthread_stop(tsk); >+ kthread_stop(pSesInfo->server->tsk); > } > } else { > cFYI(1, ("No session or bad tcon")); > if ((pSesInfo->server) && > (pSesInfo->server->tsk)) { >- struct task_struct *tsk; > force_sig(SIGKILL, > pSesInfo->server->tsk); >- tsk = pSesInfo->server->tsk; >- if (tsk) >- kthread_stop(tsk); >+ kthread_stop(pSesInfo->server->tsk); > } > } > sesInfoFree(pSesInfo);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 444865
: 309854