dbd: add -i option to invalidate AppleDouble CNID hints#2863
dbd: add -i option to invalidate AppleDouble CNID hints#2863
Conversation
When nested volumes leave behind stale CNID hints in AppleDouble files, dbd -f alone cannot fix them because cnid_add() still receives the stale hint. The new -i flag skips reading AD hints entirely, letting the database assign fresh CNIDs which are then written back to the AppleDouble files.
42ffbcd to
75e1d6e
Compare
|
🔥 Spectest (AFP 3.4) - Flamegraph (AFP_ASSERT active)Commit: 🔥 Open interactive Flamegraph (SVG) 🔝 Top 10 leaf functions
|
|
This is useful, however I'm not convinced -f cannot fix them? On rebuild Dbd -f will see that the CNID hint does not match the database, and the database wins, and the CNID ID from the DB is used overwriting the CNID hint. If the DB has no entry it saves the CNID hint into the DB checking the unique constraint on the ID key. Am I missing something? Approving as I like the start fresh ability anyway, just want to confirm my understanding |
🤖 Augment PR SummarySummary: Adds a new 🤖 Was this summary useful? React with 👍 or 👎 |
| ad_cnid = CNID_INVALID; | ||
|
|
||
| if (ADFILE_OK) { | ||
| if (dbd_flags & DBD_FLAGS_STRIP_AD) { |
There was a problem hiding this comment.
bin/dbd/cmd_dbd_scanvol.c:649: With DBD_FLAGS_STRIP_AD set, check_cnid() skips the ad_open() probe that previously set adfile_ok=1 on AD_VERSION_EA files lacking meta EA, so the later overwrite path can treat ad_open(...RDWR) failures as fatal and return CNID_INVALID for those entries.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
|
|
||
| if (ADFILE_OK) { | ||
| if (dbd_flags & DBD_FLAGS_STRIP_AD) { | ||
| dbd_log(LOGDEBUG, "Ignoring AppleDouble CNID hint for '%s/%s'", cwdbuf, name); |
There was a problem hiding this comment.
bin/dbd/cmd_dbd_scanvol.c:650: Because -i forces ad_cnid to stay CNID_INVALID, the ad_cnid != db_cnid && adfile_ok == 0 overwrite path will execute for every existing AppleDouble file even when DBD_FLAGS_SCAN (-s) is set, which appears to violate the documented “read only / no filesystem modifications” behavior.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
|
this is fair feedback, I wrote this as a hypothetical measure for the scenario where an invalid CNID was stored as AD hint, but I only tested with "normal" CNID hint repair scenarios let me bring this back to draft status and gather some evidence that the new logic is actually required |
I still like this 😉 resetting all CNIDs is feel-good |




When nested volumes leave behind stale CNID hints in AppleDouble files, dbd -f alone cannot fix them because cnid_add() still receives the stale hint. The new -i flag skips reading AD hints entirely, letting the database assign fresh CNIDs which are then written back to the AppleDouble files.