Commit graph

100 commits

Author SHA1 Message Date
Andrea Mazzoleni
cbf2040b89 Add mutex protection at the filesystem structure
In sync we need to modify the filesystem, like to call
fs_deallocate(). We need then proper protection.
This also removes the need of multiple fs_last cached value.
2016-01-09 10:18:14 +01:00
Andrea Mazzoleni
5249f9cb04 Fix various typos in comments 2016-01-02 16:52:20 +01:00
Andrea Mazzoleni
7ad70c26f8 Remove the need of helgrind/drd suppression
Using a mutex for protectign the global memory counter
should not affect performance.
2016-01-01 17:57:04 +01:00
Andrea Mazzoleni
b059457190 Disable multi thread for content write
It's not necessarely faster, so better to be safe
and avoid possible slowdown.
Also, the original reason of this feature was to detect
potential memory errors, but the original issue triggering this need
was instead not related to it. It was instead the problem to empty links.
2016-01-01 17:56:42 +01:00
Andrea Mazzoleni
354d51725b Enable again multi write for content files for monothread environments
If no thread support is present, keep the old way to write content files.
2016-01-01 17:37:00 +01:00
Andrea Mazzoleni
f4289a9d7e More explicative rename message
Some commands don't have UUID, and cannot detect
the rename.
2015-12-30 22:21:48 +01:00
Andrea Mazzoleni
a8e0214a9a Clarify the message about text content file not supported 2015-12-29 08:05:32 +01:00
Andrea Mazzoleni
cacc1cb0ce Autorename disks using UUID for matching 2015-12-28 13:55:22 +01:00
Andrea Mazzoleni
801d01c55b Store UUIDs in the disk element 2015-12-28 12:09:13 +01:00
Andrea Mazzoleni
c80fd07058 Remove warnings when building with low optimizations 2015-12-20 17:23:58 +01:00
Andrea Mazzoleni
d5c0a8c2f3 Support the case of an empty symlink
There is the report of a such condition in Windows.
2015-12-18 19:52:30 +01:00
Andrea Mazzoleni
96501697bb More os_abort() use after decoding_error() 2015-12-12 18:17:30 +01:00
Andrea Mazzoleni
fcc3894667 Add regression test for UUID change 2015-12-10 22:51:16 +01:00
Andrea Mazzoleni
f71ddbb3fd Add backtrace support for internal errors 2015-12-04 22:02:31 +01:00
Andrea Mazzoleni
a79052baa6 Add a new --test-no-warnings option
It disables annoying warnings that expert user don't
want to see.
2015-11-24 18:49:20 +01:00
Andrea Mazzoleni
b775135175 Fix a build issue when the pthread library is not available 2015-11-19 19:14:15 +01:00
Andrea Mazzoleni
496611f476 Fix an integer overflow when computing the size of a deleted entry
This bug prevented SnapRAID to read a valid content file, in case
a deleted entry bigger than 4 GB was present.
This could be reproduced deleting a file bigger than 4 GB and then sync.
2015-11-18 23:14:04 +01:00
Andrea Mazzoleni
3ea6714236 Cleanup resource on thread errors
We are going to exit() anyway, but static analyzers
don't known that.
2015-10-31 16:46:15 +01:00
Andrea Mazzoleni
06cbc7d482 Some missing coverage exclusions 2015-10-31 16:29:08 +01:00
Andrea Mazzoleni
8ff39bb9bf Fix thread operations using thread-safe functions
We have a common disk cache, that we cannot share
during multithread operations.

Intead of using a mutex to access the cache, we use a
local thread cache.
2015-10-30 19:06:24 +01:00
Andrea Mazzoleni
fcf7c44197 Use different thread when writing content file
This should reduce the possibility that the same
memory error is going to affect all the written
content files in the same way.
2015-10-29 23:37:58 +01:00
Andrea Mazzoleni
204656b129 Verify the CRC of content files after writing them 2015-10-28 22:04:04 +01:00
Andrea Mazzoleni
7e1d9138b5 Add the deplete operation at the data stream
It's used to read the content file up to the end to verify its CRC.
2015-10-28 19:36:24 +01:00
Andrea Mazzoleni
4c9da1fa43 Use a more severe error reporting for --force-device
We want to be sure that such messages are not ignored.
2015-10-18 23:04:56 +02:00
Andrea Mazzoleni
2b69cfa073 Extend the disk filtering to parity disk
You can now fix a specific parity disk,
without touching the others.
2015-10-17 17:36:40 +02:00
Andrea Mazzoleni
3e83b15bbb Extend --force-device to ignore more erroneous conditions
We want to allow fix also if some disk is unaccessible,
and content files not present.
2015-10-16 23:17:38 +02:00
Andrea Mazzoleni
fb759fec84 Rename some shadow variables
This removes some warnings in gcc 4.6 version.
2015-10-08 22:33:41 +02:00
Andrea Mazzoleni
452a595067 Adjust verbs in comments 2015-10-07 22:07:20 +02:00
Andrea Mazzoleni
25fe6a252c Extend filesystem support for deallocation in the middle
This could happen in some special cases
2015-10-05 22:48:16 +02:00
Andrea Mazzoleni
b17e618d49 Add an extensive parity filesystem check
With the new mapping it's now possible to check everything
in a very fast way.
2015-10-05 21:40:44 +02:00
Andrea Mazzoleni
9bc5f9e5ce Change the internal mapping to a tree of chunk
This is intended to save memory as now we can use a fixed
block of 17 bytes to store the block information, compared
to the previous 28/36 bytes.
2015-10-04 23:17:13 +02:00
Andrea Mazzoleni
fa775d24a8 More interface changes to prepare to the use of tree mapping 2015-10-04 22:03:58 +02:00
Andrea Mazzoleni
f719ee4f57 Switch from deleted blocks to deleted files
This will allow an easier management of the parity allocation.
2015-10-01 23:24:44 +02:00
Andrea Mazzoleni
23983d6e9c Drop text file support 2015-10-01 23:24:44 +02:00
Andrea Mazzoleni
0407c945db Change the interface for parity allocation
This will allow a more compact representation
of the parity allocation
2015-10-01 23:24:06 +02:00
Andrea Mazzoleni
9a5f30cd32 Add a new justsynced info bit to position
The value 0 means that the block is scrubbed, and it allows
an easy conversion of past content files.
Note that past versions ignore this info when using binary
content files, then we don't increase the version of the format.
2015-08-27 18:02:12 +02:00
Andrea Mazzoleni
aef11798b0 Clarify why filters could be rejected with a proper message 2015-05-30 13:18:16 +02:00
Andrea Mazzoleni
de0c437bd2 Put a clear separation between log and msg functions 2015-04-20 22:07:42 +02:00
Andrea Mazzoleni
a5a72f4a31 Change some warnings to errors to always print them on screen 2015-04-19 21:13:05 +02:00
Andrea Mazzoleni
4af4504515 Validate the smartctl string before accepting it 2015-04-10 18:29:06 +02:00
Andrea Mazzoleni
228ca866e2 Fix a missed initialization of the new smartctl variable 2015-04-08 23:10:43 +02:00
Andrea Mazzoleni
214070dc4d Add support for a new "smartctl" config option
This option allows to configure custom smartctl
commands for devices that cannot be autodetected.
2015-04-08 22:56:44 +02:00
Andrea Mazzoleni
36061561cc Some more GiB to GB conversion 2015-03-29 23:18:30 +02:00
Andrea Mazzoleni
3a4ce0b1e2 Use GB instead of GiB to be more consistent with HD size. 2015-03-29 22:18:21 +02:00
Andrea Mazzoleni
21ce043725 Use manual line buffering for stdout/stderr.
This is needed for Windows where line buffering is not supported.
2015-03-23 22:57:36 +01:00
Andrea Mazzoleni
e56de653da Introduce a new messaging system 2015-02-22 14:31:03 +01:00
Andrea Mazzoleni
fa5f31ddf9 Move stream implementation to a specific source file 2015-02-21 09:00:34 +01:00
Andrea Mazzoleni
f6611557d0 Remove some override in reading the binary state.
They have no chance to work as a wrong blockmax would
unsych the stream.
2015-02-19 19:47:22 +01:00
Andrea Mazzoleni
84949d96da Add an extra CRC check on the data written to the streams
This is intented to detect memory errors during the processing.
2015-02-18 19:27:59 +01:00
Andrea Mazzoleni
0a657cbdb0 Make the quiet option to hide the progress bar 2015-02-04 08:10:39 +01:00