From a5a72f4a31e97d2c8051a2ac8c20eda1526a26bb Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 19 Apr 2015 21:13:05 +0200 Subject: [PATCH] Change some warnings to errors to always print them on screen --- cmdline/parity.c | 6 +++--- cmdline/pool.c | 2 +- cmdline/scan.c | 2 +- cmdline/state.c | 24 ++++++++++++------------ 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmdline/parity.c b/cmdline/parity.c index 598a6120..1075ed6d 100644 --- a/cmdline/parity.c +++ b/cmdline/parity.c @@ -138,10 +138,10 @@ void parity_overflow(struct snapraid_state* state, data_off_t size) msg_tag("outofparity:%s:%s\n", disk->name, esc(file->sub)); if (first) { first = 0; - msg_warning("\nYour data requires more parity than the available space.\n"); - msg_warning("Please move the files 'outofparity' to another data disk:\n"); + msg_error("\nYour data requires more parity than the available space.\n"); + msg_error("Please move the files 'outofparity' to another data disk:\n"); } - msg_warning("outofparity %s%s\n", disk->dir, file->sub); + msg_error("outofparity %s%s\n", disk->dir, file->sub); msg_flush(); } } diff --git a/cmdline/pool.c b/cmdline/pool.c index b481d833..743be52f 100644 --- a/cmdline/pool.c +++ b/cmdline/pool.c @@ -181,7 +181,7 @@ static void make_link(const char* pool_dir, const char* share_dir, struct snapra ret = symlink(linkto_exported, path); if (ret != 0) { if (errno == EEXIST) { - msg_warning("WARNING! Duplicate pooling for '%s'\n", path); + msg_error("WARNING! Duplicate pooling for '%s'\n", path); #ifdef _WIN32 } else if (errno == EPERM) { /* LCOV_EXCL_START */ diff --git a/cmdline/scan.c b/cmdline/scan.c index 19ff18e2..96d686ff 100644 --- a/cmdline/scan.c +++ b/cmdline/scan.c @@ -1529,7 +1529,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff) /* if verbose, prints the list of duplicates real offsets */ /* other cases are for offsets not supported, so we don't need to report them file by file */ if (phy_last >= FILEPHY_REAL_OFFSET) { - msg_warning("WARNING! Files '%s%s' and '%s%s' have the same physical offset %" PRId64 ".\n", disk->dir, phy_file_last->sub, disk->dir, file->sub, phy_last); + msg_error("WARNING! Files '%s%s' and '%s%s' have the same physical offset %" PRId64 ".\n", disk->dir, phy_file_last->sub, disk->dir, file->sub, phy_last); } ++phy_dup; } diff --git a/cmdline/state.c b/cmdline/state.c index 6b45517b..a134af97 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -389,11 +389,11 @@ static void state_config_check(struct snapraid_state* state, const char* path, t #endif if (state->raid_mode == RAID_MODE_CAUCHY) { if (state->level == 3) { - msg_warning("WARNING! Your CPU doesn't have a fast implementation for triple parity.\n"); - msg_warning("WARNING! It's recommended to switch to 'z-parity' instead than '3-parity'.\n"); + msg_error("WARNING! Your CPU doesn't have a fast implementation for triple parity.\n"); + msg_error("WARNING! It's recommended to switch to 'z-parity' instead than '3-parity'.\n"); } else if (state->level > 3) { - msg_warning("WARNING! Your CPU doesn't have a fast implementation beyond triple parity.\n"); - msg_warning("WARNING! It's recommended to reduce the parity levels to triple parity.\n"); + msg_error("WARNING! Your CPU doesn't have a fast implementation beyond triple parity.\n"); + msg_error("WARNING! It's recommended to reduce the parity levels to triple parity.\n"); } } @@ -1273,15 +1273,15 @@ static void state_map(struct snapraid_state* state) /* recommend number of parities */ if (diskcount >= 36 && state->level < 6) { - msg_warning("WARNING! With %u disks it's recommended to use six parity levels.\n", diskcount); + msg_error("WARNING! With %u disks it's recommended to use six parity levels.\n", diskcount); } else if (diskcount >= 29 && state->level < 5) { - msg_warning("WARNING! With %u disks it's recommended to use five parity levels.\n", diskcount); + msg_error("WARNING! With %u disks it's recommended to use five parity levels.\n", diskcount); } else if (diskcount >= 22 && state->level < 4) { - msg_warning("WARNING! With %u disks it's recommended to use four parity levels.\n", diskcount); + msg_error("WARNING! With %u disks it's recommended to use four parity levels.\n", diskcount); } else if (diskcount >= 15 && state->level < 3) { - msg_warning("WARNING! With %u disks it's recommended to use three parity levels.\n", diskcount); + msg_error("WARNING! With %u disks it's recommended to use three parity levels.\n", diskcount); } else if (diskcount >= 5 && state->level < 2) { - msg_warning("WARNING! With %u disks it's recommended to use two parity levels.\n", diskcount); + msg_error("WARNING! With %u disks it's recommended to use two parity levels.\n", diskcount); } } @@ -4421,7 +4421,7 @@ void state_read(struct snapraid_state* state) /* otherwise continue */ if (node->next) { - msg_warning("WARNING! Content file '%s' not found, trying with another copy...\n", path); + msg_error("WARNING! Content file '%s' not found, trying with another copy...\n", path); /* ensure to rewrite all the content files */ state->need_write = 1; @@ -4472,8 +4472,8 @@ void state_read(struct snapraid_state* state) } else { /* if the size is different */ if (other_st.st_size != st.st_size) { - msg_warning("WARNING! Content files '%s' and '%s' have a different size!\n", path, other_path); - msg_warning("Likely one of the two is broken!\n"); + msg_error("WARNING! Content files '%s' and '%s' have a different size!\n", path, other_path); + msg_error("Likely one of the two is broken!\n"); /* ensure to rewrite all the content files */ state->need_write = 1;