An attempt was made to create more than the maximum number of hard links (LINK_MAX, by default 32767) to a file. Because each subdirectory is a link to its parent directory, the same error results from trying to create too many subdirectories.
Check why the file has so many links to it. To get more than the maximum number of hard links, use symbolic links instead.
The symbolic name for this error is EMLINK, errno=31.