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

zpool should detect invalid fsproperty on create #7878

Merged
merged 1 commit into from
Sep 13, 2018

Conversation

loli10K
Copy link
Contributor

@loli10K loli10K commented Sep 9, 2018

Motivation and Context

Fix #7620

Description

This change improve the handling of invalid filesystem properties when specified at pool creation: this is useful when 'zpool create -n' (dry run) is executed to detect invalid fs-level options (-O) before the actual command is run.

NOTE: this is still Work in Progress.

  • Need to add test case to the ZTS (the only occurrence of zpool create -n i could find is in "zpool_create_003_pos.ksh": i should probably update the existing test case instead of adding a new one). EDIT: done
  • Need to detect invalid dataset properties for volumes (zpool create -n -O volsize=<n> should fail). EDIT: done

How Has This Been Tested?

Manual run on local builder:

root@linux:~# POOLNAME='testpool'
root@linux:~# TMPDIR='/var/tmp'
root@linux:~# mountpoint -q $TMPDIR || mount -t tmpfs tmpfs $TMPDIR
root@linux:~# zpool destroy $POOLNAME
cannot open 'testpool': no such pool
root@linux:~# rm -f $TMPDIR/disk*
root@linux:~# truncate -s 128m $TMPDIR/zpool_$POOLNAME.dat
root@linux:~# 
root@linux:~# zpool create -n -O doesnotexist=on $POOLNAME $TMPDIR/zpool_$POOLNAME.dat
property 'doesnotexist' is not a valid filesystem property
root@linux:~# echo $?
1
root@linux:~# zpool create -n -O org.zfsonlinux:doesnotexist=on $POOLNAME $TMPDIR/zpool_$POOLNAME.dat
would create 'testpool' with the following layout:

	testpool
	  /var/tmp/zpool_testpool.dat
root@linux:~# echo $?
0

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.

@loli10K loli10K added the Status: Work in Progress Not yet ready for general review label Sep 9, 2018
This change improve the handling of invalid filesystem properties when
specified at pool creation: this is useful when 'zpool create -n'
(dry run) is executed to detect invalid fs-level options (-O) before
the actual command is run.

Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
@codecov
Copy link

codecov bot commented Sep 9, 2018

Codecov Report

Merging #7878 into master will increase coverage by 10.58%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #7878       +/-   ##
===========================================
+ Coverage   67.87%   78.45%   +10.58%     
===========================================
  Files         322      376       +54     
  Lines       97552   114006    +16454     
===========================================
+ Hits        66215    89449    +23234     
+ Misses      31337    24557     -6780
Flag Coverage Δ
#kernel 78.8% <ø> (+40.48%) ⬆️
#user 67.52% <100%> (-0.22%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8a9041...d4c2b96. Read the comment docs.

@loli10K loli10K removed the Status: Work in Progress Not yet ready for general review label Sep 9, 2018
@behlendorf behlendorf merged commit 5140a58 into openzfs:master Sep 13, 2018
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.

"zpool create -n" does not error check "-O" zfs properties
2 participants