-
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
Remove inappropiate error message suggesting to apply '-r' #9574
Conversation
Removes an incorrect error message from libzfs that suggests applying '-r' when a zfs subcommand is called with a filesystem path while expecting either a snapshot or bookmark path. Signed-off-by: InsanePrawn <[email protected]>
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.
These kind of advices should indeed only be given for things that can be described as "The usual mistakes".
Changes are clear and obviously error free...
Codecov Report
@@ Coverage Diff @@
## master #9574 +/- ##
===========================================
- Coverage 78.95% 66.42% -12.54%
===========================================
Files 418 336 -82
Lines 123681 106209 -17472
===========================================
- Hits 97653 70546 -27107
- Misses 26028 35663 +9635
Continue to review full report at Codecov.
|
@madwizard would you mind reviewing this small proposed change. |
I did some additional research we should look into: In contrast to what @InsanePrawn was saying, this issue was not introduced in #8352 but in #8047, because of the request in #7056 Which means another solution should be found for #7056 if we merge this. This also answers @InsanePrawn 's question:
This also means @behlendorf that this issue does not originate with the refactor by @madwizard in #8352 but in the changes in #8047 |
Ah, while it's nice that you found the place where -r makes sense, I stand with my two comments:
the and should probably be capitalised.
Now, for bookmarks, we can actually get the old message:
But this brings me to my second important statement:
This additional, command-specific error message should IMHO be in the command function ( |
@InsanePrawn it was not meant as an argument to devalue your PR. edit |
No hard feelings implied, 'while it's nice' was not sarcastic either. I was genuinely happy to see you find the intended usage :)
While I would argue that expecting to list snapshots with Weirdly, this doesn't work for bookmarks, as demonstrated above. Instead of reintroducing a -r hint for bookmarks, I'd argue in favour of aligning the behaviour of |
@InsanePrawn |
That's right, @tcaputi was nice enough to add this functionality in #8539. I think extending it to bookmarks would make a lot of sense if someone wants to tackle that improvement, see df58307. I'm also all for dropping this increasingly confusing hint from the common code. So let's merged this PR as is, we can always follow it up with additional improvements. |
Removes an incorrect error message from libzfs that suggests applying '-r' when a zfs subcommand is called with a filesystem path while expecting either a snapshot or bookmark path. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Kjeld Schouten <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes openzfs#9574
Removes an incorrect error message from libzfs that suggests applying '-r' when a zfs subcommand is called with a filesystem path while expecting either a snapshot or bookmark path. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Kjeld Schouten <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes openzfs#9574
Removes an incorrect error message from libzfs that suggests applying '-r' when a zfs subcommand is called with a filesystem path while expecting either a snapshot or bookmark path. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Kjeld Schouten <[email protected]> Signed-off-by: InsanePrawn <[email protected]> Closes #9574
Remove inappropiate error message suggesting to use '-r'
Removes an incorrect error message from libzfs that suggests applying
'-r' when a zfs subcommand is called with a filesystem path while
expecting either a snapshot or bookmark path.
Signed-off-by: InsanePrawn [email protected]
Removes an additional error message suggesting to append '-r' to the zfs command in case zfs_validate_name expects either a bookmark or a snapshot and gets a snapshot/bookmark without the '@'/'#'.
Motivation and Context
#8352 introduced more detailed error messages when handling dataset paths. Two of them recommend
-r
when it expects a snapshot/bookmark path but finds no '@'/'#' symbol. (lib/libzfs/libzfs_dataset.c
, currently line 123).This message seems to appear anywhere either a snapshot or bookmark path is expected but a dataset path is provided by the user. Not all commands that handle snapshots support
-r
and i doubt we should be blindly recommending it even if they did ;)In fact, after some staring at man pages and grepping through the repo, I was not able to identify a single case where the
-r
recommendation can come up and makes sense, although I'm not very familiar with the code base and could easily have missed something.Either way, I suspect
zfs_validate_name
is not the right place to recommend command options. 🙃Description
Removed the
-r
suggestion, leaving the information about expecting a snapshot/bookmark but not finding the respective separator '@'/'#'.How Has This Been Tested?
Compiled it on Debian Stretch, confirmed the new error messages match the expected result.
Types of changes
Checklist:
Signed-off-by
.