Document why automatic copy search runs before snapshot selection
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-09-27 20:17:26 +02:00
parent e7135d101b
commit cd8b331a30

View file

@ -1777,7 +1777,12 @@ int snapraid_main(int argc, char* argv[])
if (import_content != 0)
state_import(&state, import_content);
/* import from all the array */
/*
* Search the live array before switching reference disks to snapshots.
* The search is intended to find files copied or moved since the last sync;
* snapshots are instead used later for the historical state matching parity.
* Keep this before state_snapshot_write(), or recent live copies may be missed.
*/
if (!state.opt.force_nocopy)
state_search_array(&state);
}