Page MenuHomeFreeBSD

pjdfstest: Fix link count test
ClosedPublic

Authored by des on Oct 29 2025, 4:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 3, 12:45 PM
Unknown Object (File)
Tue, Mar 3, 4:00 AM
Unknown Object (File)
Tue, Mar 3, 3:59 AM
Unknown Object (File)
Tue, Mar 3, 3:59 AM
Unknown Object (File)
Tue, Mar 3, 3:58 AM
Unknown Object (File)
Thu, Feb 26, 10:08 PM
Unknown Object (File)
Tue, Feb 17, 8:23 AM
Unknown Object (File)
Tue, Feb 17, 2:06 AM
Subscribers

Details

Summary

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.")

Test Plan
make -C /usr/src/tests/sys/pjdfstest all install
md=$(mdconfig -t malloc -s 32m)
newfs /dev/$md
mount /dev/$md /mnt
cd /mnt
/usr/tests/sys/pjdfstest/link/05

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Oct 29 2025, 4:28 PM
This revision is now accepted and ready to land.Oct 30 2025, 1:09 PM
des edited the test plan for this revision. (Show Details)

more idiomatic

This revision now requires review to proceed.Oct 30 2025, 2:49 PM
This revision was not accepted when it landed; it landed in state Needs Review.Oct 30 2025, 8:18 PM
This revision was automatically updated to reflect the committed changes.