ext4 extents

Peter Teoh htmldeveloper at gmail.com
Sat Oct 29 20:52:53 EDT 2011


On Sat, Oct 29, 2011 at 6:03 AM, Mike Gibson
<mike.gibson at storagecraft.com> wrote:
> I'm updating a user space program that finds free blocks on a ext2/3 filesystem so that it works with ext4.  I'm concerned about how extents might affect my program.  My program currently looks only at the block allocation bitmaps.  Are the block allocation bitmaps still updated when an extent is created?
>

problem is what u see as free blocks may not be seen at the kernel
level as free block.....since u not holding any locks, there may be
situation when your block allocation may conflict with that of the
kernel, then u will get disastrous irrecoverable errors - worst case
is your userspace data get overwritten by kernel.

i supposed it is a legacy program, but there exists a small
probability that this problem will occur.

> >From what I can tell, extent information is only stored in the inode, and is only a way to improve the efficiency of the process of creating the structure needed in the inode.  But I haven't been able to find out anything about whether the block allocation bitmap is updated at the same time.
>
> Do extents provide a new way of expressing which blocks are allocated on disk?  Or are the block allocation bitmaps still the canonical way to determine if a given block is in use?
>
> Mike Gibson
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Regards,
Peter Teoh



More information about the Kernelnewbies mailing list