On Mon, 2007-03-19 at 17:50 -0400, James Cloos wrote:
> I've had my laptop's / on jfs for a while now.
> 
> I notice that many directories become excessively large after
> some use.  As an example:
> 
> ,----[ ls -lsd /etc /tmp ]
> |   468 drwxr-xr-x 297 root root   430080 Mar 19 17:12 /etc
> | 50016 drwxrwxrwt 122 root root 50872320 Mar 19 17:40 /tmp
> `----
> 
> Compare that with:
> 
> ,----[ /bin/ls /etc | wc -l ]
> | 607
> `----
> ,----[ /bin/ls /tmp | wc -l ]
> | 1251
> `----
> 
> This happens with any dir that has overturn.
> 
> Rsync(1)ing the dir creates a new one that is much smaller.  In the
> case of /etc it ended up taking only two fs blocks:
> 
> ,----[ ls -lsd /BAK/etc ]
> | 36 drwxr-xr-x 99 root root 8192 Mar 19 17:48 /ETC/etc
> `----
> 
> I presume it has something to do with extents?  

No.  It's a data structure I call the directory index.  It's associates
a fixed position with each entry in the directory, so that directory
traversals resume at the right point even when changes are made to the b
+-tree.  (When jfs was young, rm -rf would fail to remove everything in
the directory because the position within the directory got lost.)  It
slowly grows every time a file is created, but does not shrink when
files are deleted.  It is reset to zero if a directory is completely
emptied, but that doesn't usually happen.

I can look into a fix, either some mechanism to reuse old positions, or
something to remove the directory index and rebuild it when too much
space is wasted.

> Is there any way to prevent this growth?

Not currently.  I can look into a fix, either some mechanism to reuse
old positions, or something to remove the directory index and rebuild it
when too much space is wasted.

> -JimC
-- 
David Kleikamp
IBM Linux Technology Center


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jfs-discussion mailing list
Jfs-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jfs-discussion

Reply via email to