quality: share file-entry construction between the sequential and parallel scanners #322

Closed
opened 2026-09-23 02:10:50 +02:00 by TapTap · 1 comment
Owner

src/client/scanner.c:1024-1175 and src/client/scanner_parallel.c:214-439 re-implement the same entry construction (filter/protect, send_path, special handling, hardlink assignment, metadata, xattr capture, list-add); the parallel path inlines what the sequential path delegates to helpers (the hardlink block is byte-for-byte duplicated).

Work: extract a shared scanner_build_file_entry() and split scan_root_entry per node kind (it is 226 lines with 6-level nesting and ~12 manual-cleanup returns).

`src/client/scanner.c:1024-1175` and `src/client/scanner_parallel.c:214-439` re-implement the same entry construction (filter/protect, send_path, special handling, hardlink assignment, metadata, xattr capture, list-add); the parallel path inlines what the sequential path delegates to helpers (the hardlink block is byte-for-byte duplicated). **Work:** extract a shared `scanner_build_file_entry()` and split `scan_root_entry` per node kind (it is 226 lines with 6-level nesting and ~12 manual-cleanup returns).
TapTap added the quality label 2026-09-23 02:10:50 +02:00
Author
Owner

Fixed in PR #329. A shared scanner_build_file_entry() now backs both scanners; scan_root_entry is split per node kind with a single goto done cleanup. A review caught a critical error-propagation regression (parallel root non-dir failures were not marked as scan failures) and a link_target leak — both fixed. Closing as completed.

Fixed in PR #329. A shared `scanner_build_file_entry()` now backs both scanners; `scan_root_entry` is split per node kind with a single `goto done` cleanup. A review caught a critical error-propagation regression (parallel root non-dir failures were not marked as scan failures) and a `link_target` leak — both fixed. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#322