zpool: Add zpool status -vv error ranges#17864
zpool: Add zpool status -vv error ranges#17864tonyhutter wants to merge 1 commit intoopenzfs:masterfrom
Conversation
|
Sample output: |
|
Just the filenames (JSON): |
45b19a7 to
eb6a882
Compare
eb6a882 to
6c63c6a
Compare
1c4134d to
b939af9
Compare
11fbd66 to
6a2cf00
Compare
49eb048 to
0e11fb1
Compare
|
This is now passing all CI test. Reviewers - would you mind taking another look? |
behlendorf
left a comment
There was a problem hiding this comment.
I only managed to make it through the first patch but I wanted to post a first round of feedback. I like the direction this is going!
| return (0); | ||
|
|
||
| return (8 * sizeof (uint64_t) - __builtin_clzll(i)); | ||
| } |
There was a problem hiding this comment.
We don't want to split up highbit64 and lowbit64 so let's move them both here.
While you're at it we can also define them a little more concisely. Unfortunately, gcc documentation for __builtin_clzll states the result is undefined when the value is zero so we need to keep that check.
#define highbit64(x) (((x) == 0) ? 0 : CHAR_BIT * sizeof(x) - __builtin_clzll(x))
#define lowbit64(x) (__builtin_ffsll(x))This is a purely mechanical bit of cleanup so if you can move the highbit64/lowbit64 change in to its own PR we could get that chunk merged more quickly.
Let's also pull btree and range_tree refactoring in to its own PR. That way we can test it in isolation.
lib/librange_tree/Makefile.am
Outdated
| @@ -0,0 +1,7 @@ | |||
| librange_tree_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) $(LIBRARY_CFLAGS) | |||
| # librange_tree_la_CFLAGS += -fvisibility=hidden | |||
There was a problem hiding this comment.
Shouldn't be commented out.
lib/librange_tree/Makefile.am
Outdated
| noinst_LTLIBRARIES += librange_tree.la | ||
|
|
||
| nodist_librange_tree_la_SOURCES = module/zfs/range_tree.c | ||
| nodist_EXTRA_librange_tree_la_SOURCES = module/zfs/btree.c |
lib/libspl/include/sys/sysmacros.h
Outdated
|
|
||
| #include <stdint.h> | ||
|
|
||
| #include <sys/param.h> |
There was a problem hiding this comment.
I believe you'll want <limits.h> for CHAR_BIT and the highbit64/lowbit64 changes.
| module/zcommon/zprop_common.c | ||
| module/zcommon/zprop_common.c \ | ||
| module/zfs/btree.c \ | ||
| module/zfs/range_tree.c |
There was a problem hiding this comment.
We don't want to include these as sources. They should be added to the _LIBADD section as you did for libzpool.
lib/libzfs/Makefile.am
Outdated
|
|
||
| libzfs_la_LIBADD += -lrt -lm $(LIBCRYPTO_LIBS) $(ZLIB_LIBS) $(LIBFETCH_LIBS) $(LTLIBINTL) | ||
|
|
||
| # libzfs_la_LDFLAGS = -pthread -lrange_tree -lbtree |
| include $(srcdir)/%D%/libbtree/Makefile.am | ||
| include $(srcdir)/%D%/libicp/Makefile.am | ||
| include $(srcdir)/%D%/libnvpair/Makefile.am | ||
| include $(srcdir)/%D%/librange_tree/Makefile.am |
There was a problem hiding this comment.
Can you also update the diagram above.
module/zcommon/zfs_comutil.c
Outdated
| #include <sys/nvpair.h> | ||
| #include "zfs_comutil.h" | ||
| #include <sys/zfs_ratelimit.h> | ||
| #include <sys/dmu.h> |
There was a problem hiding this comment.
It looks like this can be dropped.
| libzfs_core.la | ||
|
|
||
| libzfs_core.la \ | ||
| libbtree.la |
There was a problem hiding this comment.
You should be able to drop libzpool.la and libzfs_core.la here. I'm pretty sure they were only being added to pull in the btree implementation. Plus dropping them will let us verify the new library can be used stand alone in user space.
module/zfs/btree.c
Outdated
| kmem_cache_t *zfs_btree_leaf_cache; | ||
| #ifndef _KERNEL | ||
| #include <stdio.h> | ||
| #include <stdlib.h> |
There was a problem hiding this comment.
Do you recall what you need to pull these two headers in for?
|
@behlendorf let me move over the btree/range_tee commit to another PR as you suggested, and I'll address your comments in there. |
Here's the btree/range_tree PR #18133. I believe it addresses all your comments. We'll put this PR on ice until #18133 is merged. |
Print the byte error ranges with 'zpool status -vv'. This works with the normal zpool status formatting flags (-p, -j, --json-int). In addition: - Move range_tree/btree to common userspace/kernel code. - Modify ZFS_IOC_OBJ_TO_STATS ioctl to optionally return "extended" object stats. - Let zinject corrupt zvol data. - Add test case. This commit takes code from these PRs: openzfs#17502 openzfs#9781 openzfs#8902 Signed-off-by: Tony Hutter <hutter2@llnl.gov> Co-authored-by:: Alan Somers <asomers@gmail.com> Co-authored-by: TulsiJain <tulsi.jain@delphix.com>
0e11fb1 to
92999cd
Compare
Motivation and Context
Print error byte ranges with
zpool status -vvDescription
Print the byte error ranges with 'zpool status -vv'. This works with all the normal zpool status formatting flags:
-p,-j,--json-intIn addition:
This commit takes code from these PRs: #17502 #9781 #8902
How Has This Been Tested?
Test case added
Types of changes
Checklist:
Signed-off-by.