-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
zdb: cleanup and improve cachefile handling #16071
Conversation
When cachefile property is set to none, do [-d] or [-O] options require the -e option? or is that automated as well? |
@akashb-22 - Considering |
5679047
to
8570c68
Compare
I see some disparity when I use the pool-name and dataset name as target.
I think the dataset as the target doesn't go well here maybe, I'm not sure, the same with -e seems to be working fine. |
@akashb-22 - I have made some adjustments to automate the scenario you mentioned. Can you give it a try now? |
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.
LGTM.
cmd/zdb/zdb.c
Outdated
if (strpbrk(pname, "/@") != NULL) | ||
*strpbrk(pname, "/@") = '\0'; | ||
|
||
if ((g_zfs = libzfs_init()) && (zhp = zpool_open_canfail(g_zfs, |
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.
Making the libzfs_handle_t
global is the convention used elsewhere but given the very specific need here let's make this a local variable and then immediately close the handle when we're done with it.
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
@behlendorf - I have updated the patch according to your suggestions and rebased it with master branch. The |
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.
Thanks for restructuring this. Those CI failures look unrelated to me but I'll resubmit those failed runs to make sure.
Motivation and Context
Description
/etc/default/zpool.cache
, removed, or the cachefile property is set to none, zdb fails to show the pool unless we specify the cache file or use the-e
option. This PR automates this process.How Has This Been Tested?
CI Tests and tested with the following five scenarios. Without this patch, only scenario 1 works without specifying additional arguments:
/etc/zfs/zpool.cache
, and the file exists./etc/zfs/zpool.cache
, and the file does not exist./data/zfs/zpool.cache
, and the file exists./data/zfs/zpool.cache
, and the file does not exist.none
.Types of changes
Checklist:
Signed-off-by
.