Nice catch! Yup, e2fsck will create an empty directory entry, instead
of letting the previous entry absorb the extra space. Both are legal
ways of doing things, but yes, the kernel does the latter in all cases
except when deleting the last directory entry in a block. (But that's
OK, because the split code would never need to be invoked on an empty
directory block.)
> dx_make_map need to skip the empty entry. So here is the patch for
> review before I push it back to htree BK repository.
That patch looks fine. Push away!
> Ted, is e2fsck endian free now? I notice some code in
> copy_dir_entries() do not have cpu_to_le32 for rec_len etc.
Yes, e2fsprogs is endian-free. The byte swapping happens in the
library routine ext2fs_read_dir_block() and ext2fs_write_dir_block().
Note that you have to tell these routines whether you're planning on
using the v2 version of dirent struct or not, because that affects
whether or not the name_len field needs to be byte-swapped or not.
- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/