-
Notifications
You must be signed in to change notification settings - Fork 1.9k
zpool: fix conflict with -v and -o options #17839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice straightforward fix, good job!
Fixes openzfs#11040. Right now, the -v and -o options for `zpool list` work independently, but when paired, the -v "wins out" and the -o effect is lost. This commit fixes that problem. Signed-off-by: Shreshth Srivastava <[email protected]>
0ed555e
to
4c1785c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I made the necessary changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking closer, while it does look like a step in a right direction, I think we should go further now. For example, dedup
field has nothing to do with vdevs, but it is present in this code. Same time bclone_ratio
absent here is not printed properly:
mav@genoa2:~# zpool list -v -o name,dedup,bclone_ratio,health optane
NAME DEDUP BCLONE_RATIO HEALTH
optane 1.00x 1.00x ONLINE
nvd0p1 - ONLINE
nvd10p1 - ONLINE
nvd11p1 - ONLINE
nvd12p1 - ONLINE
nvd13p1 - ONLINE
nvd1p1 - ONLINE
nvd2p1 - ONLINE
nvd3p1 - ONLINE
nvd4p1 - ONLINE
nvd5p1 - ONLINE
nvd6p1 - ONLINE
nvd7p1 - ONLINE
nvd8p1 - ONLINE
nvd9p1 - ONLINE
Can we remove explicit mention of not applicable properties, but instead handle them all universally?
Fixes #11040.
Right now, the -v and -o options for
zpool list
work independently, but when paired, the -v "wins out" and the -o effect is lost. This commit fixes that problem.Before my change:
(master) ~/zfs$ ./zpool list -v -o name,health mypool NAME HEALTH mypool ONLINE mirror-0 960M 110K 960M - - 2% 0.01% - ONLINE loop17 1G - - - - - - - ONLINE loop18 1G - - - - - - - ONLINE
After my change:
(v-o-option-conflict) ~/zfs$ ./zpool list -v -o name,health mypool NAME HEALTH mypool ONLINE mirror-0 ONLINE loop17 ONLINE loop18 ONLINE
Types of changes
Checklist:
Signed-off-by
.