Page MenuHomeFreeBSD

makefs: emit NM records for all directory entries
ClosedPublic

Authored by emaste on Mar 24 2023, 6:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 3:16 PM
Unknown Object (File)
Wed, Nov 6, 3:12 PM
Unknown Object (File)
Wed, Nov 6, 3:12 PM
Unknown Object (File)
Tue, Nov 5, 2:51 AM
Unknown Object (File)
Oct 5 2024, 6:42 AM
Unknown Object (File)
Oct 5 2024, 6:42 AM
Unknown Object (File)
Oct 5 2024, 6:42 AM
Unknown Object (File)
Oct 5 2024, 6:21 AM
Subscribers

Details

Summary
We previously attempted to emit Rock Ridge NM records only when the name
represented by the Rock Ridge extensions would actually differ. We would
omit the record for an all-upper-case directory name, but Linux (and
perhaps other operating systems) mapped that to lowercase.

This affected only directories, as file names have an implicit ";1"
version number appended and thus always differ.  To solve, emit NM
records for all entries.

We could continue to omit the NM record for directories that would avoid
mapping (for example, one named 1234.567) but this does not seem worth
the complexity.

PR:             203531
Reported by:    Thomas Schmitt <scdbackup@gmx.net
Sponsored by:   The FreeBSD Foundation

Diff Detail

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

Event Timeline

emaste created this revision.
emaste added a reviewer: jrtc27.

We could continue to omit the NM record for directories that would avoid
mapping (for example, one named 1234.567) but this does not seem worth
the complexity.

+1

I was looking at cd9660_rrip_add_NM to get a sense of how much overhead we're talking, and I found this slightly amusing:"

/*                                                                      
 * Each NM record has 254 bytes to work with. This means that           
 * the name data itself only has 249 bytes to work with. So, a          
 * name with 251 characters would require two nm records.               
 */

It seems silly to use 251 as the example for a length requiring two records instead of the minimum 250.

This revision is now accepted and ready to land.Mar 25 2023, 4:03 AM