Commit graph

166 commits

Author SHA1 Message Date
Andrea Mazzoleni
a39fb132f8 Normalize comment style
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
2026-10-07 09:14:01 +02:00
Andrea Mazzoleni
6b8d3e23a0 Drop support for pre-SnapRAID 11 content formats and require migration with SnapRAID 14.x 2026-09-26 17:15:09 +02:00
Andrea Mazzoleni
bcc06e10c6 Reject parity sizes exceeding data_off_t range and remove redundant block size casts 2026-09-24 20:40:27 +02:00
Andrea Mazzoleni
bcfd2734b6 Quiesce scrub read-ahead before autosave and distinguish read/write barriers 2026-09-24 19:49:46 +02:00
Andrea Mazzoleni
222136f1e7 Leave block empty for unlocalized close errors and use zero for parity open errors
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
2026-09-23 16:37:13 +02:00
Andrea Mazzoleni
1a5b28ad38 Mark scrub/sync blocks bad when data file open fails with an I/O error 2026-09-23 16:24:00 +02:00
Andrea Mazzoleni
c6951393e8 Exit code and logging invariants for log_fatal and hardware log_error
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
2026-09-21 17:27:07 +02:00
Andrea Mazzoleni
902c19b668 Specialize block hash copies for the full hash size 2026-09-10 23:51:30 +02:00
Andrea Mazzoleni
4a616558ec Treat trusted REBUILD hash mismatches as persistent silent data corruption 2026-09-09 15:46:59 +02:00
Andrea Mazzoleni
62ae6c3552 Replace physical reach tracking with the natural file and parity EOF
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
2026-09-09 13:03:11 +02:00
Andrea Mazzoleni
9db5dc5ed1 Mark sync as incomplete on SIGINT during thermal cooldown to prevent premature commit 2026-09-08 10:42:14 +02:00
Andrea Mazzoleni
e8726ce95a Add regression tests and document parity size requirements when adding a parity level 2026-09-08 10:34:26 +02:00
Andrea Mazzoleni
6971bd58c9 Improve missing parity warning to recommend initialization via fix instead of force-full sync 2026-09-08 09:58:57 +02:00
Andrea Mazzoleni
74647cda14 Make snapraid_io track started state and defer async I/O after initial thermal control 2026-09-07 10:15:13 +02:00
Andrea Mazzoleni
f9819266e7 Abort cooldown sleep and break caller loops immediately on interruption 2026-09-06 23:37:05 +02:00
Andrea Mazzoleni
be3957f939 Ensure parity durability barrier in sync when there are no blocks to sync 2026-09-05 10:39:07 +02:00
Andrea Mazzoleni
d96eecfd60 Persist content state and bad block markings on sync errors while preserving deallocation state 2026-09-04 09:52:41 +02:00
Andrea Mazzoleni
0b64fb2eae Eliminate obsolete raid_zero API and dedicated zero buffers
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
2026-09-02 20:49:06 +02:00
Andrea Mazzoleni
0ce89aa35d Add support for selectable streaming vs cached parity generation 2026-09-02 17:26:02 +02:00
Andrea Mazzoleni
472c85a4fb Centralize canonical SnapRAID block hashing semantics 2026-08-31 20:45:38 +02:00
Andrea Mazzoleni
80b58e66d5 Initialize parity split sizes before pre-resize state checkpoint 2026-08-31 10:39:17 +02:00
Andrea Mazzoleni
f8319361a3 Disallow elastic parity split reallocation during fix to preserve persisted layout 2026-08-31 10:39:17 +02:00
Andrea Mazzoleni
f6d07dfa10 Persist pending logical state before parity resize on normal shrink sync 2026-08-31 10:39:17 +02:00
Andrea Mazzoleni
82be7b07b3 Persist reallocated mapping before parity resize in force-realloc sync 2026-08-31 10:39:17 +02:00
Andrea Mazzoleni
395291bd9a Implement crash-safe --force-full sync with persistent BLOCK_STATE_REBUILD 2026-08-31 10:39:17 +02:00
Andrea Mazzoleni
cea7ce7f0a Document non-obvious invariants across sync, check, scrub, parity, and handle mapping logic 2026-08-31 10:39:17 +02:00
Andrea Mazzoleni
8d63a85b76 Clarify metadata validation semantics in sync comments 2026-08-31 10:39:17 +02:00
Andrea Mazzoleni
b959f0056e Quiesce read-ahead before thermal spin-down 2026-08-18 23:33:58 +02:00
Andrea Mazzoleni
4423c8c895 Detect truncated parity using the contiguous valid physical prefix 2026-08-18 23:33:58 +02:00
Andrea Mazzoleni
ef6fa54ee2 Fix parity writer error propagation in io_flush and abort sync on parity write failures 2026-08-18 23:33:58 +02:00
Andrea Mazzoleni
f453a72369 Preserve recovery state until a full clean sync completes 2026-08-18 23:33:57 +02:00
Andrea Mazzoleni
661e539f45 Defer pending snapshot promotion until parity sync 2026-08-18 23:33:57 +02:00
Andrea Mazzoleni
0ca7c65049 Support filesystems with invalid inode numbers on individual files 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
ebe2bbe76c Document handle_close failures 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
bbcdb72a9f Introduce nalloc_nofail 2026-08-18 23:33:55 +02:00
Andrea Mazzoleni
00b4cbafd0 Merge the CLI and Daemon portable interface 2026-08-18 23:33:55 +02:00
Andrea Mazzoleni
f40b2decdb Further conversions from 32 to 64 bits 2026-08-18 23:33:54 +02:00
Andrea Mazzoleni
bbd3c23cd2 Migrate block_off_t to 64-bit with updated CLI parsing, VLQ serialization, and format specifiers 2026-08-18 23:33:54 +02:00
Andrea Mazzoleni
76998613da Remove the unused number of data disks from the vector allocation
The same addressing rules are applied to the parity disks because
they are used as data disks during recovery operations.
2026-08-18 23:33:54 +02:00
Andrea Mazzoleni
58fece3584 Extend io_init() to support arbitrary combinations of data and parity operations 2026-08-18 23:33:53 +02:00
Andrea Mazzoleni
4a37e3fece Change the BLOCK_HASH_SIZE type to avoid potential overflow 2026-08-18 23:33:53 +02:00
Andrea Mazzoleni
76ce1cbb16 Add regression check for Btrfs
It requires root privileges as it has to create Btrfs filesystems.
2026-08-18 23:33:52 +02:00
Andrea Mazzoleni
275063d23c Track deallocated files in the content file for parity recovery
Add a new 'dealloc' list per disk to record files that were removed
or modified during a scan. This list is saved in the content file
(new format version SNAPCNT4) so that past parity contributions of
those files can be imported from previous snapshots.
2026-08-18 23:33:52 +02:00
Andrea Mazzoleni
54602422dd Change commenting style 2026-08-18 23:33:52 +02:00
Andrea Mazzoleni
1227a8c45e Sync no longer requires clearing the past hash
It no longer assumes past hashes are valid if even a single unsynced
block exists, which indicates a previous sync was interrupted.

While this makes syncing slower after an interruption, it preserves the
past hash in the content file, enabling a more reliable fix if a
disk fails following an incomplete sync.

This ensures the --import option remains functional even after an
interrupted sync.
2026-08-18 23:33:52 +02:00
Andrea Mazzoleni
5cfebba19e Remove unnecessary log argument 2026-06-03 20:57:08 +02:00
Andrea Mazzoleni
cc99a22929 Add protection for block position integer overflow 2026-06-03 19:07:31 +02:00
Andrea Mazzoleni
cf452a091d Log using log_error all errors that are not resulting in an early termination 2026-06-03 12:33:29 +02:00
Andrea Mazzoleni
96e20b3912 Switch esc_tag and path formatting to a contiguous thread-local circular pool to eliminate stack bloat
Some checks failed
Build / build-mac (push) Has been cancelled
Build / build-linux (push) Has been cancelled
Build / build-win (push) Has been cancelled
CodeQL Advanced / Analyze (c-cpp) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
2026-05-29 11:22:04 +02:00
Andrea Mazzoleni
492ad40f2c Simpler handling of skip_sync 2026-05-21 16:08:03 +02:00