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

Deceptive error when creating a zpool with options, without root permissions #9550

Closed
justinlovinger opened this issue Nov 5, 2019 · 4 comments
Labels
good first issue Indicates a good issue for first-time contributors Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@justinlovinger
Copy link

justinlovinger commented Nov 5, 2019

System information

Type Version/Name
Distribution Name NixOS
Distribution Version 19.09
Linux Kernel 4.19.78
Architecture x86_64
ZFS Version 0.8.2-1
SPL Version 0.8.2-1

Describe the problem you're observing

While trying to create a pool with autotrim, I get the error:
cannot create 'pool': property 'autotrim'(31) not defined.
man zpool show that autotrim is a valid property.
I can use zpool set autotrim=on pool.

Describe how to reproduce the problem

  1. $ dd if=/dev/zero of=/tmp/poolfile bs=100MB count=1
  2. $ zpool create -o autotrim=on temp /tmp/poolfile

Include any warning/errors/backtraces from the system logs

Update

A little more testing shows that the error only occurs when trying to run zpool create ... without root permissions, and is similar for other options. It looks like the real issue is that the error message is deceptive.

@justinlovinger
Copy link
Author

The error here isn't related to s3backer. See the Update for more information.

@GregorKopka
Copy link
Contributor

the error only occurs when trying to run zpool create ... without root permissions, and is similar for other options. It looks like the real issue is that the error message is deceptive.

Please rename the issue accordingly.

@loli10K loli10K added good first issue Indicates a good issue for first-time contributors Type: Defect Incorrect behavior (e.g. crash, hang) labels Nov 6, 2019
@justinlovinger justinlovinger changed the title Property 'autotrim' not defined Deceptive error when creating a zpool with options, without root permissions Nov 7, 2019
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Dec 26, 2019
When `zpool create -o <property>` is run without root permissions
and the pool property requested is not specifically enumerated in
zpool_valid_proplist().  Then an incorrect error message referring
to an invalid property is printed rather than the expected permission
denied error.

Specifying a pool property at create time should be handled the same
way as filesystem properties in zfs_valid_proplist().  There should
not be default zfs_error_aux() set for properties which are not
listed.

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#9550
Closes openzfs#9568
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Dec 27, 2019
When `zpool create -o <property>` is run without root permissions
and the pool property requested is not specifically enumerated in
zpool_valid_proplist().  Then an incorrect error message referring
to an invalid property is printed rather than the expected permission
denied error.

Specifying a pool property at create time should be handled the same
way as filesystem properties in zfs_valid_proplist().  There should
not be default zfs_error_aux() set for properties which are not
listed.

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#9550
Closes openzfs#9568
tonyhutter pushed a commit that referenced this issue Jan 23, 2020
When `zpool create -o <property>` is run without root permissions
and the pool property requested is not specifically enumerated in
zpool_valid_proplist().  Then an incorrect error message referring
to an invalid property is printed rather than the expected permission
denied error.

Specifying a pool property at create time should be handled the same
way as filesystem properties in zfs_valid_proplist().  There should
not be default zfs_error_aux() set for properties which are not
listed.

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9550
Closes #9568
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

4 participants
@GregorKopka @loli10K @justinlovinger and others