Commit 930c07f9 authored by Chris Mason's avatar Chris Mason Committed by Linus Torvalds

[PATCH] reiserfs: block allocator should not inherit "packing locality 1"

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
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 734db689
......@@ -258,7 +258,12 @@ static inline int block_group_used(struct super_block *s, u32 id) {
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment