Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
mdadm.5365
0072-Show-all-bitmaps-while-examining-bitmap.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0072-Show-all-bitmaps-while-examining-bitmap.patch of Package mdadm.5365
From b98043a2f8e7bb5b1918e2e02778f822f9dd4d3a Mon Sep 17 00:00:00 2001 From: Guoqing Jiang <gqjiang@suse.com> Date: Wed, 10 Jun 2015 13:42:07 +0800 Subject: [PATCH 105/359] Show all bitmaps while examining bitmap References: bsc#1081910 This adds capability of exmining bitmaps corresponding to all nodes/slots on the device. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Coly Li <colyli@suse.de> --- bitmap.c | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/bitmap.c b/bitmap.c index 920033a..0c3f6de 100644 --- a/bitmap.c +++ b/bitmap.c @@ -260,7 +260,7 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) int rv = 1; char buf[64]; int swap; - int fd; + int fd, i; __u32 uuid32[4]; fd = bitmap_file_open(filename, &st); @@ -317,9 +317,13 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) uuid32[2], uuid32[3]); - printf(" Events : %llu\n", (unsigned long long)sb->events); - printf(" Events Cleared : %llu\n", (unsigned long long)sb->events_cleared); - printf(" State : %s\n", bitmap_state(sb->state)); + if (sb->nodes == 0) { + printf(" Events : %llu\n", (unsigned long long)sb->events); + printf(" Events Cleared : %llu\n", (unsigned long long)sb->events_cleared); + printf(" State : %s\n", bitmap_state(sb->state)); + + } + printf(" Chunksize : %s\n", human_chunksize(sb->chunksize)); printf(" Daemon : %ds flush period\n", sb->daemon_sleep); if (sb->write_behind) @@ -329,11 +333,40 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) printf(" Write Mode : %s\n", buf); printf(" Sync Size : %llu%s\n", (unsigned long long)sb->sync_size/2, human_size(sb->sync_size * 512)); - if (brief) - goto free_info; - printf(" Bitmap : %llu bits (chunks), %llu dirty (%2.1f%%)\n", - info->total_bits, info->dirty_bits, - 100.0 * info->dirty_bits / (info->total_bits?:1)); + + if (sb->nodes == 0) { + if (brief) + goto free_info; + printf(" Bitmap : %llu bits (chunks), %llu dirty (%2.1f%%)\n", + info->total_bits, info->dirty_bits, + 100.0 * info->dirty_bits / (info->total_bits?:1)); + } else { + printf(" Cluster nodes : %d\n", sb->nodes); + printf(" Cluster name : %64s\n", sb->cluster_name); + for (i = 0; i < (int)sb->nodes; i++) { + if (i) { + free(info); + info = bitmap_fd_read(fd, brief); + sb = &info->sb; + } + if (sb->magic != BITMAP_MAGIC) + pr_err("invalid bitmap magic 0x%x, the bitmap file appears to be corrupted\n", sb->magic); + + printf(" Node Slot : %d\n", i); + printf(" Events : %llu\n", + (unsigned long long)sb->events); + printf(" Events Cleared : %llu\n", + (unsigned long long)sb->events_cleared); + printf(" State : %s\n", bitmap_state(sb->state)); + if (brief) + continue; + printf(" Bitmap : %llu bits (chunks), %llu dirty (%2.1f%%)\n", + info->total_bits, info->dirty_bits, + 100.0 * info->dirty_bits / (info->total_bits?:1)); + + } + } + free_info: free(info); return rv; -- 2.16.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor