-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 gets confused by datasets starting with numbers #12845
Comments
It turns out that the -d /dataset | objsetID is not going to be a good zdb command line interface for using the numeric objset id, for the reason you're seeing. stroull will convert 1M to 1 and then not find it. Also tank/100 is a valid dataset name so it's ambiguous if you want it to be an objsetID or dataset name string. I had originally done
but we didn't go with that. Now we have objectID ranges to consider if we adopt a ":" separator. Ideas welcome. |
I'd probably opt for a variant of that, really - something like I'd still prefer it if the existing logic did something like "try as path name" => "if it fails, try as objsetid", and then you can unambiguously specify it if you need to? (Mostly in that order because I think people are more likely to run into the case of "I have a dataset named 100 and want to reference it when there's an objsetid 100" than "I have an objsetid 100 and there's a dataset named 100 i wanted to reference instead".) |
I'll work on getting the "try as dataset name" => "if it fails and (if numeric looking), try as objsetID" working. Also the way it uses args[2] is wrong and won't work if you have other args so I'm already fixing that. |
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Fixes openzfs#12845 Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Fixes openzfs#12845 Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Fixes openzfs#12845 Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Fixes openzfs#12845 Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes #12845 Closes #12944
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes openzfs#12845 Closes openzfs#12944
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes #12845 Closes #12944
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes openzfs#12845 Closes openzfs#12944
zdb -d <pool>/<objset ID> does not work when other command line arguments are included i.e. zdb -U <cachefile> -d <pool>/<objset ID> This change fixes the command line parsing to handle this situation. Also fix issue where zdb -r <dataset> <file> does not handle the root <dataset> of the pool. Introduce -N option to force <objset ID> to be interpreted as a numeric objsetID. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rich Ercolani <rincebrain@gmail.com> Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> Closes openzfs#12845 Closes openzfs#12944
System information
Describe the problem you're observing
(I'll go figure out a "correct" handling for this later, I just wanted to mention it in case I forgot after I ran into it...)
I tried to examine a child dataset under a dataset named "1M", at the top of a pool, "lz4newtestpool".
But if I rename 1M to sigh1M, it works as expected.
I would presume this is due to:
zfs/cmd/zdb/zdb.c
Lines 8525 to 8539 in 510885a
since patching the second check to not exit(1) and reset objset_id to -1 allows us to proceed, albeit having printed the error.
Describe how to reproduce the problem
sudo zdb -d pool/1zzz
Include any warning/errors/backtraces from the system logs
GOTO 10
The text was updated successfully, but these errors were encountered: