mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-25 01:16:31 -05:00
Compare commits
10 commits
9fc16eb4da
...
ef3572ea73
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef3572ea73 | ||
|
|
3696bccf68 | ||
|
|
5b0bc91c49 | ||
|
|
80bb5af22e | ||
|
|
8ee24aa26c | ||
|
|
1d2ab288d1 | ||
|
|
66ebf5db8b | ||
|
|
9146d02845 | ||
|
|
62b506673a | ||
|
|
cb81bb9fc7 |
10 changed files with 64 additions and 53 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -5,6 +5,7 @@
|
|||
*.txz
|
||||
*.deb
|
||||
*.rpm
|
||||
*.zst
|
||||
|
||||
# backups
|
||||
*~
|
||||
|
|
@ -63,6 +64,7 @@ pkg/.SRCINFO
|
|||
*.dst
|
||||
*.epr
|
||||
*.geany
|
||||
session.conf
|
||||
|
||||
# AFL
|
||||
makeafl.sh
|
||||
|
|
|
|||
4
HISTORY
4
HISTORY
|
|
@ -1,6 +1,10 @@
|
|||
SnapRAID HISTORY
|
||||
================
|
||||
|
||||
14.0rc3d 22/03/2026
|
||||
===================
|
||||
* Fixed data race on the new RELOCATED flag
|
||||
|
||||
14.0rc3c 16/03/2026
|
||||
===================
|
||||
* Log additional information to allow to handle dynamic devices associations
|
||||
|
|
|
|||
|
|
@ -83,12 +83,8 @@ int handle_create(struct snapraid_handle* handle, struct snapraid_file* file, in
|
|||
|
||||
if (handle->f == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
/* invalidate for error */
|
||||
handle->file = 0;
|
||||
handle->f = -1;
|
||||
handle->valid_size = 0;
|
||||
|
||||
log_fatal(errno, "Error opening file '%s'. %s.\n", handle->path, strerror(errno));
|
||||
handle_close(handle);
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -101,6 +97,7 @@ int handle_create(struct snapraid_handle* handle, struct snapraid_file* file, in
|
|||
if (ret != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(errno, "Error accessing file '%s'. %s.\n", handle->path, strerror(errno));
|
||||
handle_close(handle);
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -112,6 +109,7 @@ int handle_create(struct snapraid_handle* handle, struct snapraid_file* file, in
|
|||
if (ret != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(errno, "Error advising file '%s'. %s.\n", handle->path, strerror(errno));
|
||||
handle_close(handle);
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -168,17 +166,13 @@ int handle_open(struct snapraid_handle* handle, struct snapraid_file* file, int
|
|||
/* open for read */
|
||||
handle->f = open_noatime(handle->path, flags | O_RDONLY);
|
||||
if (handle->f == -1) {
|
||||
/* invalidate for error */
|
||||
handle->file = 0;
|
||||
handle->f = -1;
|
||||
handle->valid_size = 0;
|
||||
|
||||
if (errno == ENOENT)
|
||||
out_missing(errno, "Missing file '%s'.\n", handle->path);
|
||||
else if (errno == EACCES)
|
||||
out(errno, "Permission denied for file '%s'.\n", handle->path);
|
||||
else
|
||||
out(errno, "Error opening file '%s'. %s.\n", handle->path, strerror(errno));
|
||||
handle_close(handle);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -190,6 +184,7 @@ int handle_open(struct snapraid_handle* handle, struct snapraid_file* file, int
|
|||
if (ret != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
out(errno, "Error accessing file '%s'. %s.\n", handle->path, strerror(errno));
|
||||
handle_close(handle);
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -201,6 +196,7 @@ int handle_open(struct snapraid_handle* handle, struct snapraid_file* file, int
|
|||
if (ret != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
out(errno, "Error advising file '%s'. %s.\n", handle->path, strerror(errno));
|
||||
handle_close(handle);
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,6 +177,9 @@ void os_init(int opt)
|
|||
}
|
||||
|
||||
exedir_init();
|
||||
|
||||
/* set LC_ALL=C to make smartctl ignoring the locale when printing info */
|
||||
_wputenv_s(L"LC_ALL", L"C");
|
||||
}
|
||||
|
||||
void os_done(void)
|
||||
|
|
|
|||
|
|
@ -906,8 +906,8 @@ int parse_option_size(const char* arg, uint64_t* out_size)
|
|||
char* e;
|
||||
|
||||
/* parse the number part */
|
||||
data_off_t size = strtoul(optarg, &e, 10);
|
||||
if (!e || e == arg)
|
||||
data_off_t size = strtoul(arg, &e, 10);
|
||||
if (e == arg)
|
||||
return -1;
|
||||
|
||||
/* Handle suffixes */
|
||||
|
|
@ -919,7 +919,7 @@ int parse_option_size(const char* arg, uint64_t* out_size)
|
|||
size *= GIGA;
|
||||
} else if ((e[0] == 't' || e[0] == 'T') && e[1] == 0) {
|
||||
size *= TERA;
|
||||
} else if (e[0] != '\0') {
|
||||
} else if (e[0] != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1100,18 +1100,23 @@ int snapraid_main(int argc, char* argv[])
|
|||
plan100 = SCRUB_FULL;
|
||||
} else {
|
||||
double plan_double = strtod(optarg, &e);
|
||||
plan100 = plan_double * 100;
|
||||
if (!e || *e || plan100 > 10000) {
|
||||
if (e == optarg
|
||||
|| *e != 0
|
||||
|| !isfinite(plan_double)
|
||||
|| plan_double < 0
|
||||
|| plan_double > 100
|
||||
) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid plan/percentage '%s'\n", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
plan100 = plan_double * 100;
|
||||
}
|
||||
break;
|
||||
case 'o' :
|
||||
olderthan = strtoul(optarg, &e, 10);
|
||||
if (!e || *e || olderthan > 1000) {
|
||||
if (e == optarg || *e || olderthan > 1000) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid number of days '%s'\n", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -1135,7 +1140,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
break;
|
||||
case 'S' :
|
||||
blockstart = strtoul(optarg, &e, 0);
|
||||
if (!e || *e) {
|
||||
if (e == optarg || *e) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid start position '%s'\n", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -1144,7 +1149,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
break;
|
||||
case 'B' :
|
||||
blockcount = strtoul(optarg, &e, 0);
|
||||
if (!e || *e) {
|
||||
if (e == optarg || *e) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid count number '%s'\n", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -1153,7 +1158,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
break;
|
||||
case 'L' :
|
||||
opt.io_error_limit = strtoul(optarg, &e, 0);
|
||||
if (!e || *e) {
|
||||
if (e == optarg || *e) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid error limit number '%s'\n", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -1258,7 +1263,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
break;
|
||||
case OPT_GUI_THRESHOLD_REMOVES :
|
||||
opt.gui_threshold_removes = strtoul(optarg, &e, 0);
|
||||
if (!e || *e) {
|
||||
if (e == optarg || *e) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid threshold '%s'\n", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
@ -1267,7 +1272,7 @@ int snapraid_main(int argc, char* argv[])
|
|||
break;
|
||||
case OPT_GUI_THRESHOLD_UPDATES :
|
||||
opt.gui_threshold_updates = strtoul(optarg, &e, 0);
|
||||
if (!e || *e) {
|
||||
if (e == optarg || *e) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EUSER, "Invalid threshold '%s'\n", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
|||
|
|
@ -2724,7 +2724,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
|
|||
if (ret < 0 || mapping >= mapping_max) {
|
||||
/* LCOV_EXCL_START */
|
||||
decoding_error(path, f);
|
||||
log_fatal(EINTERNAL, "Internal inconsistency: Dir mapping index ouf of range!\n");
|
||||
log_fatal(EINTERNAL, "Internal inconsistency: Dir mapping index out of range!\n");
|
||||
os_abort();
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2404,6 +2404,9 @@ void os_init(int opt)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* set LC_ALL=C to make smartctl ignoring the locale when printing info */
|
||||
setenv("LC_ALL", "C", 1);
|
||||
|
||||
(void)opt;
|
||||
}
|
||||
|
||||
|
|
|
|||
26
makecheck.sh
26
makecheck.sh
|
|
@ -17,6 +17,30 @@ if ! $SOURCE/configure; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if ! time make check; then
|
||||
if ! make -j4; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! make check; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! make distclean; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! $SOURCE/configure --host=x86_64-w64-mingw32.static --build=`$SOURCE/config.guess`; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! make -j4; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! make check; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! make distclean; then
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
17
makedist.sh
17
makedist.sh
|
|
@ -1,17 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
|
||||
CHECK=check
|
||||
DEBUG=
|
||||
|
||||
if test "x$1" = "x-f"; then
|
||||
CHECK=all
|
||||
fi
|
||||
|
||||
if test "x$1" = "x-d"; then
|
||||
DEBUG=--enable-debug
|
||||
fi
|
||||
|
||||
# Ask root permissions at the start
|
||||
sudo echo We are root
|
||||
|
||||
|
|
@ -20,7 +9,7 @@ make distclean
|
|||
# Reconfigure (with force) to get the latest revision from git
|
||||
autoreconf -f
|
||||
|
||||
if ! ./configure.windows-x86 $DEBUG; then
|
||||
if ! ./configure.windows-x86; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -32,11 +21,11 @@ if ! make distwindows-x86 distclean; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if ! ./configure.windows-x64 $DEBUG; then
|
||||
if ! ./configure.windows-x64; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! make -j4 $CHECK; then
|
||||
if ! make -j4; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Run all the Coverage and Valgrind tests
|
||||
# Run all the Valgrind tests
|
||||
#
|
||||
|
||||
# Source directory
|
||||
|
|
@ -15,21 +15,6 @@ cd $DEST
|
|||
|
||||
cp $SOURCE/valgrind.supp $DEST
|
||||
|
||||
# Coverage
|
||||
if ! $SOURCE/configure --enable-coverage --enable-sde; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! make lcov_reset check lcov_capture lcov_html; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp -a cov $SOURCE/cov
|
||||
|
||||
if ! make distclean; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Valgrind
|
||||
if ! $SOURCE/configure --enable-valgrind; then
|
||||
exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue