Felipe Monteiro de Carvalho
2014-08-27 10:20:14 UTC
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 =)
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
Felipe Monteiro de Carvalho