On Dec 23, 2008 13:02 +0900, Toshiyuki Okajima wrote: > Zhang Xiliang wrote: >> Hi, >> >> I creat 65537 long directories and failed when the block size is 1024. >> >> # mkfs.ext4dev -b 1024 -I 256 /dev/hda3 >> # tune2fs -E test_fs -O extents /dev/hda3 >> # mount -t ext4dev /dev/hda3 /mnt >> # ./create_long_dirs 65537 /mnt >> >> The code of create_long_dirs.c: > > ext4 filesystem cannot make over 65000 links toward a file. > (ext3 filesystem cannot make over 32000 links toward a file.) > This test makes over 65000 links toward /mnt-directory. > (Creating 65000 sub-directories makes 65000 links toward /mnt-directory.) Note that there is a specific reason why it was implemented this way: - a directory with > 65000 subdirectories can be checked if empty even if the link count is wrong (in fact link count was ignored even in ext3) - a file needs to keep accurate link counts or it is impossible to know when the file needs to be deleted. We thought about adding a "i_links_count_hi" but it wasn't thought that many (any) real applications would create so many hard links on the same file. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc. -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html