Re: bug in scsi.c

From: Tigran Aivazian (tigran@veritas.com)
Date: Thu Dec 07 2000 - 18:07:19 EST


On Thu, 7 Dec 2000, Andreas Klein wrote:
> > 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.
>
> Nearly correct, the daemonize function does NOT call exit_files.

I do not post messages to linux-kernel without checking the facts
first. Read the daemonize() function and see for yourself that you are
wrong.

Regards,
Tigran

PS, Here it is, to save you time opening kernel/sched.c. The kernel is, of
course, test12-pre7.

/*
 * Put all the gunge required to become a kernel thread without
 * attached user resources in one place where it belongs.
 */

void daemonize(void)
{
        struct fs_struct *fs;

        /*
         * If we were started as result of loading a module, close all of
the
         * user space pages. We don't need them, and if we didn't close
them
         * they would be locked into memory.
         */
        exit_mm(current);

        current->session = 1;
        current->pgrp = 1;

        /* Become as one with the init task */

        exit_fs(current); /* current->fs->count--; */
        fs = init_task.fs;
        current->fs = fs;
        atomic_inc(&fs->count);
        exit_files(current);
        current->files = init_task.files;
        atomic_inc(&current->files->count);
}

-
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/



This archive was generated by hypermail 2b29 : Thu Dec 07 2000 - 21:00:19 EST