mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* BUG: 2.4.19pre1 & journal_thread & open filehandles
@ 2002-04-12 10:11 Ph. Marek
  2002-04-13 18:45 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Ph. Marek @ 2002-04-12 10:11 UTC (permalink / raw)
  To: linux-kernel

Hello everybody!

I think I have discovered a bug in the way the kernel journal thread is
created.
I tested with ext3 but believe that every fs using jbd has this bug.

Description:
------------

A kernel journaling thread is created for every journaled filesystem which
gets mounted. The problem is, that the thread gets every open filehandle of
the mount-process added to the thread-filedescriptor-table.

Example:
Process 4 is a kjournald
On the shell (bash) I do a 
   exec 10< /etc/services
to open fd 10, then
   mount -t ext3 /usr
to create a new kjournald with pid (eg) 25.
Now
	ls -la /proc/4/fd 
or
	ls -la /proc/25/fd
BOTH show a link "10 -> /etc/services".

I tried a short program which closes all filehandles and then execs mount,
but as of this test the filehandles get only added, never removed.

I believe this to be a serious bug as it's impossible to umount the
underlying filesystems (devfs and /) as AT LEAST 0,1 & 2 are used with
mount, and using pivot_root to change to a shmfs and then umounting
everything INCLUDING / isn't possible - the kjournald for / has
/dev/console open, and /dev is mounted below / ...


BTW: is the VFS-lock patch already in 2.4.19preX or will it be included in
the near future??

Thanks for reading and giving some replies.


Regards,

Phil




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: BUG: 2.4.19pre1 & journal_thread & open filehandles
  2002-04-12 10:11 BUG: 2.4.19pre1 & journal_thread & open filehandles Ph. Marek
@ 2002-04-13 18:45 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2002-04-13 18:45 UTC (permalink / raw)
  To: Ph. Marek; +Cc: linux-kernel

> I think I have discovered a bug in the way the kernel journal thread is
> created.
> I tested with ext3 but believe that every fs using jbd has this bug.

It should be sufficient to use daemonize() and reparent_to_init() to hand
off the inherited handles


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-13 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-12 10:11 BUG: 2.4.19pre1 & journal_thread & open filehandles Ph. Marek
2002-04-13 18:45 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®