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)
Feb 19 2024, 10:11 PM
Unknown Object (File)
Feb 10 2024, 9:39 PM
Unknown Object (File)
Dec 27 2023, 9:43 PM
Unknown Object (File)
Dec 23 2023, 1:05 AM
Unknown Object (File)
Nov 5 2023, 12:35 AM
Unknown Object (File)
Aug 13 2023, 6:21 PM
Unknown Object (File)
Jul 12 2023, 5:55 AM
Unknown Object (File)
Jul 12 2023, 5:53 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