Skip to content
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

Fix zfs_ioc_pool_sync should not use fnvlist #6529

Merged
merged 1 commit into from
Aug 21, 2017
Merged

Conversation

tuxoko
Copy link
Contributor

@tuxoko tuxoko commented Aug 18, 2017

Use fnvlist on user input would allow user to easily panic zfs.

Signed-off-by: Chunwei Chen [email protected]

Description

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commit messages are properly formatted and contain Signed-off-by.
  • Change has been approved by a ZFS on Linux member.

Use fnvlist on user input would allow user to easily panic zfs.

Signed-off-by: Chunwei Chen <[email protected]>
@behlendorf behlendorf requested a review from alek-p August 18, 2017 00:47
force = fnvlist_lookup_boolean_value(innvl, "force");
if (innvl) {
if (nvlist_lookup_boolean_value(innvl, "force", &force) != 0) {
err = SET_ERROR(EINVAL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be better to do spa_close(spa, FTAG); return (SET_ERROR(EINVAL)) instead of adding a goto?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with either way here. It's largely a matter of what's more readable and less likely to accidentally introduce a bug here in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code is cleaner without a goto but that might be subjective, so I'm OK either way as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, then I'll merge this as-is. Thanks.

@behlendorf behlendorf merged commit 05f85a6 into openzfs:master Aug 21, 2017
tuxoko added a commit to tuxoko/zfs that referenced this pull request Aug 22, 2017
Use fnvlist on user input would allow user to easily panic zfs.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Alek Pinchuk <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs#6529
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Jan 16, 2018
Use fnvlist on user input would allow user to easily panic zfs.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Alek Pinchuk <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs#6529
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Jan 18, 2018
Use fnvlist on user input would allow user to easily panic zfs.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Alek Pinchuk <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs#6529
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Jan 18, 2018
Use fnvlist on user input would allow user to easily panic zfs.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Alek Pinchuk <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs#6529
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Jan 19, 2018
Use fnvlist on user input would allow user to easily panic zfs.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Alek Pinchuk <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes openzfs#6529
tonyhutter pushed a commit that referenced this pull request Feb 6, 2018
Use fnvlist on user input would allow user to easily panic zfs.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: Alek Pinchuk <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes #6529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants