Penguin
Annotated edit history of EMLINK version 2, including all changes. View license author blame.
Rev Author # Line
1 JohnMcPherson 1 __Too Many Links__
2
3 There are too many hard links to a file or directory on a filesystem. The exact number allowed is file-system dependent. Eg /usr/src/linux-2.4.19/include/linux/sysv_fs.h contains:
4 enum {
5 XENIX_LINK_MAX = 126, /* ?? */
6 SYSV_LINK_MAX = 126, /* 127? 251? */
7 V7_LINK_MAX = 126, /* ?? */
8 COH_LINK_MAX = 10000,
9 };
10 while /usr/src/linux-2.4.19/include/linux/ext3_fs.h has:
11 #define EXT3_LINK_MAX 32000
12 and /usr/src/linux-2.4.19/include/linux/reiserfs_fs.h has:
13 #define REISERFS_LINK_MAX (MAX_US_INT - 1000)
14 (for maximum unsigned integer on the system).
15
2 PerryLorier 16 This could be caused by a directory having too many subdirectories (each subdirectory has .. as a hardlink to it's parent directory which causes that directory's hardlink count to be increased by one. So yes, this does mean that you are limited to 32000 subdirectories in one directory in ext3, even if you have hashdirs enabled.) As a consequence of this you can stat(2) a directory and add one (for ..) and you will know how many directories are in the current directory. (or subtract one (for .) to find out how many subdirectories there are).
17
18 Some file systems (such as [FAT]) don't have hardlinks so the hardlink count can't overflow, and you can't rely on the hardlink count of a directory to be representive of how many subdirectories it has.
19
20 What a confusing world we live in.