[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] open files in kjounald (2)



On Monday 22 April 2002 08:49 am, Andrew Morton wrote:
> "Ph. Marek" wrote:
> > ...
> > --- linux.ori/fs/jbd/journal.c  Mon Apr 22 06:28:54 2002
> > +++ linux/fs/jbd/journal.c      Mon Apr 22 06:29:16 2002
> > @@ -204,7 +204,6 @@
> >
> >         lock_kernel();
> >         daemonize();
> > +       exit_files(current);

No need: Daemonize is already calling exit_files().

> >         spin_lock_irq(&current->sigmask_lock);
> >         sigfillset(&current->blocked);
> >         recalc_sigpending(current);
>
> Confused.  The daemonize() call makes kjournald use init's
> files:

That's because in daemonize() we have:

        exit_files(current);
        current->files = init_task.files;		<====
        atomic_inc(&current->files->count);	<====

But why should a kernel-daemon need init's files?



Some places call both daemonize() _and_ exit_files() which is
redundant (checking on 2.4.19-pre7-a2):

	block/loop.c :: loop_thread()
	usb/storage/usb.c :: usb_stor_control_thread()


-- Itai





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]