Duplicate directory entries were not necessarily getting found and
fixed for non-indexed directories, since we were sorting these
directories by inode number, and the duplicate entry code assumed the
entries were getting sorted by name or directory name hash.
Addresses-Sourceforge-Bug: #
2862551
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/* Sort the list */
resort:
- if (fd.compress)
- qsort(fd.harray+2, fd.num_array-2,
- sizeof(struct hash_entry), ino_cmp);
- else
- qsort(fd.harray, fd.num_array,
- sizeof(struct hash_entry), hash_cmp);
+ qsort(fd.harray, fd.num_array, sizeof(struct hash_entry), hash_cmp);
/*
* Look for duplicates
goto errout;
}
+ /* Sort non-hashed directories by inode number */
+ if (fd.compress)
+ qsort(fd.harray+2, fd.num_array-2,
+ sizeof(struct hash_entry), ino_cmp);
+
/*
* Copy the directory entries. In a htree directory these
* will become the leaf nodes.
--- /dev/null
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Duplicate entry 'test-008' found.
+ Marking / (2) to be rebuilt.
+
+Pass 3: Checking directory connectivity
+Pass 3A: Optimizing directories
+Entry 'test-008' in / (2) has a non-unique filename.
+Rename to test-0~0? yes
+
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 21/256 files (0.0% non-contiguous), 1087/2048 blocks
+Exit status is 1
--- /dev/null
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 21/256 files (0.0% non-contiguous), 1087/2048 blocks
+Exit status is 0
--- /dev/null
+duplicate directory entries for non-indexed dirs