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

Always track temporary fses and snapshots for accounting #10791

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

pcd1193182
Copy link
Contributor

Signed-off-by: Paul Dagnelie [email protected]

Motivation and Context

Issue #10698

Description

The root cause of the issue is that we only occasionally do as the comments in the code suggest and actually ignore the %recv dataset when it comes to filesystem limit tracking. Specifically, the only time we ignore it is when initializing the filesystem and snapshot limit values; when creating a new %recv dataset or deleting one, we always update the bookeeping. This causes a problem if you init the fs count on a filesystem that already has a %recv dataset, since the bookmarking will be decremented but not incremented. This is resolved in this patch by simply always tracking the %recv dataset as a child.

How Has This Been Tested?

A new test has been added to verify that the issue that started this investigation doesn't occur anymore.

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.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

@pcd1193182 pcd1193182 added the Status: Code Review Needed Ready for review and testing label Aug 24, 2020
@pcd1193182 pcd1193182 requested review from grwilson and ahrens August 24, 2020 20:58
@pcd1193182 pcd1193182 self-assigned this Aug 24, 2020
@ahrens
Copy link
Member

ahrens commented Aug 25, 2020

@jjelinek Could you take a look at this and verify that the %recv special-casing is not that important here, and it's OK to change the design to match what was actually implemented.

@codecov
Copy link

codecov bot commented Aug 25, 2020

Codecov Report

Merging #10791 into master will increase coverage by 0.22%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10791      +/-   ##
==========================================
+ Coverage   79.49%   79.72%   +0.22%     
==========================================
  Files         395      395              
  Lines      125039   125038       -1     
==========================================
+ Hits        99401    99687     +286     
+ Misses      25638    25351     -287     
Flag Coverage Δ
#kernel 80.44% <100.00%> (+0.05%) ⬆️
#user 66.05% <50.00%> (+1.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
module/zfs/dsl_dir.c 89.18% <100.00%> (-0.02%) ⬇️
cmd/zdb/zdb_il.c 30.86% <0.00%> (-24.08%) ⬇️
module/zfs/vdev_raidz.c 90.85% <0.00%> (-2.94%) ⬇️
lib/libzfs/libzfs_changelist.c 84.26% <0.00%> (-1.88%) ⬇️
module/zfs/zrlock.c 95.08% <0.00%> (-1.64%) ⬇️
module/zfs/zap_micro.c 85.35% <0.00%> (-1.26%) ⬇️
cmd/zed/agents/fmd_serd.c 78.21% <0.00%> (-1.00%) ⬇️
cmd/zdb/zdb.c 82.05% <0.00%> (-0.93%) ⬇️
module/icp/api/kcf_cipher.c 15.76% <0.00%> (-0.83%) ⬇️
cmd/zed/agents/zfs_mod.c 76.89% <0.00%> (-0.67%) ⬇️
... and 60 more

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 184df27...a2705b7. Read the comment docs.

module/zfs/dsl_dir.c Outdated Show resolved Hide resolved
Copy link
Contributor

@jjelinek jjelinek left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Aug 25, 2020
@behlendorf behlendorf merged commit 4aa3b3b into openzfs:master Aug 27, 2020
behlendorf pushed a commit that referenced this pull request Aug 27, 2020
The root cause of the issue is that we only occasionally do as the
comments in the code suggest and actually ignore the %recv dataset when
it comes to filesystem limit tracking. Specifically, the only time we
ignore it is when initializing the filesystem and snapshot limit values;
when creating a new %recv dataset or deleting one, we always update
the bookkeeping. This causes a problem if you init the fs count on a
filesystem that already has a %recv dataset, since the bookmarking
will be decremented but not incremented. This is resolved in this
patch by simply always tracking the %recv dataset as a child.

Reviewed-by: Matt Ahrens <[email protected]>
Reviewed by: Jerry Jelinek <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes #10791
@ahrens ahrens mentioned this pull request Jan 26, 2021
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
The root cause of the issue is that we only occasionally do as the 
comments in the code suggest and actually ignore the %recv dataset when 
it comes to filesystem limit tracking. Specifically, the only time we 
ignore it is when initializing the filesystem and snapshot limit values; 
when creating a new %recv dataset or deleting one, we always update 
the bookkeeping. This causes a problem if you init the fs count on a 
filesystem that already has a %recv dataset, since the bookmarking 
will be decremented but not incremented. This is resolved in this 
patch by simply always tracking the %recv dataset as a child.

Reviewed-by: Matt Ahrens <[email protected]>
Reviewed by: Jerry Jelinek <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes openzfs#10791
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
The root cause of the issue is that we only occasionally do as the 
comments in the code suggest and actually ignore the %recv dataset when 
it comes to filesystem limit tracking. Specifically, the only time we 
ignore it is when initializing the filesystem and snapshot limit values; 
when creating a new %recv dataset or deleting one, we always update 
the bookkeeping. This causes a problem if you init the fs count on a 
filesystem that already has a %recv dataset, since the bookmarking 
will be decremented but not incremented. This is resolved in this 
patch by simply always tracking the %recv dataset as a child.

Reviewed-by: Matt Ahrens <[email protected]>
Reviewed by: Jerry Jelinek <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes openzfs#10791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants