BUG: 2.4.19pre1 & journal_thread & open filehandles

From: Ph. Marek (marek@bmlv.gv.at)
Date: Fri Apr 12 2002 - 05:11:09 EST


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

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



This archive was generated by hypermail 2b29 : Mon Apr 15 2002 - 22:00:20 EST