About this list Date view Thread view Subject view Author view Attachment view

From: Jacques Gelinas (jack_at_solucorp.qc.ca)
Date: Wed 16 Oct 2002 - 06:07:46 BST


A new kernel patch is out. It is not much different from ctx-13. In fact
there are only two changes: Support for sparc64 and a nasty little bug.

Now, this is kind of funny that this bug was never noticed. Very odd. It
is kind of spectacular. It is related to unification and affects both ext2
and ext3 filesystems. Basically, when a file is unified, it can't be removed
from the hard drive. It can be unlink from all directories, but the disk
space is never recovered! Wow!

The problem came from a little implementation issue of the ext2/3 filesystem.
There are two operation: Unlink and truncate. The unlink option is implemented
on top of the truncate operation. Mostly, when a file is unlinked and its
usage count goes to 0, it is truncated and then the inode is freed.

The unlink operation had the proper patch to understand the new
immutable-may-unlink flag. But the truncate operation was not. In fact, an
immutable file should never be truncate even if it has the immutable-may-unlink
flag on.

So file were unlinked, the inode freed, but the disk space never recovered.

I fixed that by splitting the truncate operation. The first level carry all the
checking for immutability and will refuse to truncate. The bottom part
do not check those flags. The bottom part is shared by the truncate and unlink
operation.

Now, how to fix the mess we have: fsck. That's all. fsck will uncover all those
lost disk areas. It will produce quite a few request.

to trigger an fsck on the root partition, distribution are using a trick (redhat does).
Create a file called /forcefsck in the root directory and reboot.

While this bug is spectacular (the fsck messages are ...), I can't see how
this would lead to any data loss or corruption. This probably explains why
noone ever noticed. In fact, if you use unification, you have not triggered
the bug that often, unless you have upgraded all vservers including th
reference one.

---------------------------------------------------------
Jacques Gelinas <jack_at_solucorp.qc.ca>
vserver: run general purpose virtual servers on one box, full speed!
http://www.solucorp.qc.ca/miscprj/s_context.hc


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 06 Nov 2002 - 07:03:43 GMT by hypermail 2.1.3