pjdfstest: Fix link count test
This UFS-only test verifies that attempting to create more links than
permitted by the file system returns EMLINK, but has been broken ever
since UFS_LINK_MAX was increased because a) it hardcodes the previous
value of UFS_LINK_MAX, and b) the new value requires more space than
the test allocates, so it ends up getting ENOSPC instead of EMLINK.
- Switch to retrieving {PC_LINK_MAX} at runtime.
- Stop the test when we reach {PC_LINK_MAX} links. This ensures that we don't go on for hours if the actual limit turns out to be much higher than we anticipated (e.g. INT64_MAX on ZFS).
- Double the size of the test filesystem.
MFC after: 3 days
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Fixes: 35a301555bff ("Increase UFS/FFS maximum link count from 32767 to 65530.")
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D53442
(cherry picked from commit 6c86379b0d0deb2750a662579f63d71ffa519e81)