From 3e8425b5643326e16ce283109edc5f516e21d7f7 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 18 Apr 2018 15:18:43 -0400 Subject: features/bitrot: show the corresponding brick for the corrupted objects Currently with "gluster volume bitrot scrub status" command the corrupted objects of a node are shown. But to what brick that corrupted object belongs to is not shown. Showing the brick of the corrupted object will help in situations where a node hosts multiple bricks of a volume. Change-Id: I7fbdea1e0072b9d3487eb10757468bc02d24df21 fixes: bz#1569198 Signed-off-by: Raghavendra Bhat --- xlators/features/bit-rot/src/bitd/bit-rot-scrub.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'xlators') diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c index 0e706c92dff..7012f2f0a4a 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c @@ -1741,6 +1741,7 @@ br_collect_bad_objects_of_child (xlator_t *this, br_child_t *child, int32_t j = 0; int32_t tmp_count = 0; char *entry = NULL; + char tmp[PATH_MAX] = {0, }; ret = dict_get_int32 (child_dict, "count", &count); if (ret) @@ -1753,11 +1754,15 @@ br_collect_bad_objects_of_child (xlator_t *this, br_child_t *child, ret = dict_get_str (child_dict, key, &entry); if (ret) continue; + + snprintf (tmp, PATH_MAX, "%s ==> BRICK: %s", + entry, child->brick_path); snprintf (main_key, PATH_MAX, "quarantine-%d", tmp_count); - ret = dict_set_dynstr_with_alloc (dict, main_key, entry); - if (!ret) - tmp_count++; + + ret = dict_set_dynstr_with_alloc (dict, main_key, tmp); + if (!ret) + tmp_count++; } ret = tmp_count; -- cgit