lkml.org 
[lkml]   [2000]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: bug in scsi.c
On Thu, 7 Dec 2000, Andreas Klein wrote:

> hello,
>
> I have found a problem in scsi.c which in present in the 2.2 and 2.4
> series. the scsi error handler thread is created with:
>
> kernel_thread((int (*)(void *)) scsi_error_handler,
> (void *) shpnt, 0);
>
> This will lead to problems, when you have to umount the filesystem on
> which the scsi-hostapter module is located.
> To solve to problem I would propose to change this to:
>
> kernel_thread((int (*)(void *)) scsi_error_handler,
> (void *) shpnt, CLONE_FILES);

Hi Andreas,

Unfortunately, CLONE_FILES is not enough because the module may be loaded
from the directory containing it, i.e. the thread's cwd may point to that
filesystem and that would keep it busy. Or-ing CLONE_FS into flags
wouldn't help either...

A proper way to release the references to resources is to call daemonize()
function from within the kernel thread function, which calls
exit_fs()/exit_files() internally.

Regards,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:51    [W:0.034 / U:4.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site