From 6729e2d0eb8b103f07b92aa05172793a323d5016 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 11 Dec 2025 12:49:44 +0100 Subject: [PATCH] Some minimal tags changes --- cmdline/check.c | 8 ++++---- cmdline/state.c | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmdline/check.c b/cmdline/check.c index 0aebb29b..e7458447 100644 --- a/cmdline/check.c +++ b/cmdline/check.c @@ -1512,17 +1512,17 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna unsuccessful = 1; log_error("Error stating empty file '%s'. %s.\n", path, strerror(errno)); - log_tag("error:%s:%s: Empty file stat error\n", disk->name, esc_tag(file->sub, esc_buffer)); + log_tag("empty_error:%s:%s: Empty file stat error\n", disk->name, esc_tag(file->sub, esc_buffer)); ++error; } else if (!S_ISREG(st.st_mode)) { unsuccessful = 1; - log_tag("error:%s:%s: Empty file error for not regular file\n", disk->name, esc_tag(file->sub, esc_buffer)); + log_tag("empty_error:%s:%s: Empty file error for not regular file\n", disk->name, esc_tag(file->sub, esc_buffer)); ++error; } else if (st.st_size != 0) { unsuccessful = 1; - log_tag("error:%s:%s: Empty file error for size '%" PRIu64 "'\n", disk->name, esc_tag(file->sub, esc_buffer), (uint64_t)st.st_size); + log_tag("empty_error:%s:%s: Empty file error for size '%" PRIu64 "'\n", disk->name, esc_tag(file->sub, esc_buffer), (uint64_t)st.st_size); ++error; } @@ -1583,7 +1583,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna /* LCOV_EXCL_STOP */ } - log_tag("fixed:%s:%s: Fixed empty file\n", disk->name, esc_tag(file->sub, esc_buffer)); + log_tag("empty_fixed:%s:%s: Fixed empty file\n", disk->name, esc_tag(file->sub, esc_buffer)); ++recovered_error; log_tag("status:recovered:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer)); diff --git a/cmdline/state.c b/cmdline/state.c index e6078266..1a0de1ec 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -2812,6 +2812,12 @@ static void state_read_content(struct snapraid_state* state, const char* path, S pathcpy(state->parity[v_level].split_map[0].uuid, sizeof(state->parity[v_level].split_map[0].uuid), v_uuid); state->parity[v_level].total_blocks = v_total_blocks; state->parity[v_level].free_blocks = v_free_blocks; + + /* log the info read from the content file */ + log_tag("content:%s:0:%s:%s:%" PRIi64 "\n", lev_config_name(v_level), + state->parity[v_level].split_map[0].path, + state->parity[v_level].split_map[0].uuid, + state->parity[v_level].split_map[0].size); } } else if (c == 'Q') { /* from SnapRAID 11.0 the 'Q' command include size info and multi file support */