
From: Chris Mason <mason@suse.com>

reiserfsck --rebuild-tree expects the only key with a packing locality of 1 to
be for the root directory (key [1 2]).  The new block allocator inherited that
packing locality down to subdirectories, which triggers failures in reiserfsck
--rebuild-tree

reiserfsck in readonly check mode doesn't complain about this, thanks to Jeff
Mahoney for finding it.

The fix is to never inherit packing locality #1


---

 25-akpm/fs/reiserfs/bitmap.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -puN fs/reiserfs/bitmap.c~reiserfs-block-allocator-should-not-inherit-packing-locality fs/reiserfs/bitmap.c
--- 25/fs/reiserfs/bitmap.c~reiserfs-block-allocator-should-not-inherit-packing-locality	Fri May 21 17:01:46 2004
+++ 25-akpm/fs/reiserfs/bitmap.c	Fri May 21 17:01:46 2004
@@ -258,7 +258,12 @@ static inline int block_group_used(struc
 u32 reiserfs_choose_packing(struct inode *dir) {
     u32 packing;
     if (TEST_OPTION(packing_groups, dir->i_sb)) {
-	if (block_group_used(dir->i_sb,le32_to_cpu(INODE_PKEY(dir)->k_dir_id)))
+	u32 parent_dir = le32_to_cpu(INODE_PKEY(dir)->k_dir_id);
+	/*
+	 * some versions of reiserfsck expect packing locality 1 to be
+	 * special
+	 */
+	if (parent_dir == 1 || block_group_used(dir->i_sb,parent_dir))
             packing = INODE_PKEY(dir)->k_objectid;
         else
             packing = INODE_PKEY(dir)->k_dir_id;

_
