Discussion:
Ghost items in the end of a dir listing
Felipe Monteiro de Carvalho
2014-08-27 10:20:14 UTC
Permalink
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:

Loading Image...

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

Loading Image...

thanks for any tips =)
--
Felipe Monteiro de Carvalho
Dave Chinner
2014-09-05 00:39:18 UTC
Permalink
Post by Felipe Monteiro de Carvalho
Hello,
No ideas about this? =(
I know *exactly* what is going on.
Post by Felipe Monteiro de Carvalho
Any kind of tip would be really appreciated =)
TANSTAAFL.

You are asking an open source community for help developing your
closed source project. If you want our help, then it should be
pretty obvious what you need to do....

Cheers,

Dave.
--
Dave Chinner
***@fromorbit.com
Loading...