Ghost items in the end of a dir listing

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Aug 27 05:20:14 CDT 2014


Hello,

I am writing a program that reads XFS partitions and I am having
trouble with some dir listings. In some directories in the block that
starts with XD2B there is first the list of all directory items, which
I read without problems, and then there is a free item, for example:

  xfs_dir2_data_unused
    freetag -> XFS_DIR2_DATA_FREE_TAG */
    length -> 9A0
    tag -> zero

But after this free item there is still room in the block, so my
program will try to read the next item. I cannot stop the reading
because it is possible to have valid items, then a free item and then
more valid items.

The next item start might be something like:

00 00 00 2E 00 00 00 02 16

So it is not a free item, as it doesn't start with FF = XFS_DIR2_DATA_FREE_TAG
But it isn't valid either, as its name is a bunch of trash =(

So my questions are:
1> What are those ghost items in the end of the block?
2> Which criteria should be utilized to differentiate them from valid
items? I tried some guesses but nothing really works so far...

Here are screenshots of the actual data involved, here showing the
item with XFS_DIR2_DATA_FREE_TAG:

http://magnifier.sourceforge.net/temp/xfs/xfs_dir_listing_XD2B_FREE_item.png

And here showing the area in the end of the block with wierd items:

http://magnifier.sourceforge.net/temp/xfs/xfs_dir_listing_XD2B_after_FREE.png

thanks for any tips =)
-- 
Felipe Monteiro de Carvalho



More information about the xfs mailing list