public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Ghost items in the end of a dir listing
@ 2014-08-27 10:20 Felipe Monteiro de Carvalho
  2014-09-04 10:14 ` Felipe Monteiro de Carvalho
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Monteiro de Carvalho @ 2014-08-27 10:20 UTC (permalink / raw)
  To: xfs

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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-05  0:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27 10:20 Ghost items in the end of a dir listing Felipe Monteiro de Carvalho
2014-09-04 10:14 ` Felipe Monteiro de Carvalho
2014-09-05  0:39   ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox