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

OpenZFS 6529 - Properly handle updates of variably-sized SA entries. #5606

Merged
merged 1 commit into from Jan 19, 2017

Conversation

gmelikov
Copy link
Member

@gmelikov gmelikov commented Jan 16, 2017

Authored by: Andriy Gapon avg@icyb.net.ua
Reviewed by: Brian Behlendorf behlendorf1@llnl.gov
Reviewed by: Matthew Ahrens mahrens@delphix.com
Reviewed by: Ned Bass bass6@llnl.gov
Reviewed by: Tim Chase tim@chase2k.com
Approved by: Gordon Ross gwr@nexenta.com
Ported-by: George Melikov mail@gmelikov.ru

OpenZFS-issue: https://www.illumos.org/issues/6529
OpenZFS-commit: openzfs/openzfs@e7e978b

This issue was first fixed in ZoL
(5d862cb)
and then a modified version of the patch was landed in the upstream codebase.
Check out the discussion in openzfs/openzfs#24 .

This commit aligns ZoL with OpenZFS codebase.

During the update process in sa_modify_attrs(), the sizes of existing
variably-sized SA entries are obtained from sa_lengths[]. The case where
a variably-sized SA was being replaced neglected to increment the index
into sa_lengths[], so subsequent variable-length SAs would be rewritten
with the wrong length. This patch adds the missing increment operation
so all variably-sized SA entries are stored with their correct lengths.

Another problem was that index into attr_desc[] was increased even when
an attribute was removed. If that attribute was not the last attribute,
then the last attribute was lost.

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)

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.
  • Change has been approved by a ZFS on Linux member.

@mention-bot
Copy link

@gmelikov, thanks for your PR! By analyzing the history of the files in this pull request, we identified @behlendorf, @dweeezil and @nedbass to be potential reviewers.

@dweeezil
Copy link
Contributor

@gmelikov My memory is a bit fuzzy on this one, however, IIRC, this is effectively a slightly different implementation of 5d862cb which was merged to ZoL sometime earlier. There's certainly no problem adopting this version of the patch for the sake of code alignment, however, the comments should indicate a bit more about the history; specifically that the issue was first fixed in ZoL and then a modified version of the patch was landed in the upstream codebase. Check out the discussion in openzfs/openzfs/issues/24.

@gmelikov
Copy link
Member Author

@dweeezil thank you for information, i'll add comments about this.

Authored by: Andriy Gapon <avg@icyb.net.ua>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Ported-by: George Melikov mail@gmelikov.ru

OpenZFS-issue: https://www.illumos.org/issues/6529
OpenZFS-commit: openzfs/openzfs@e7e978b

This issue was first fixed in ZoL
(openzfs@5d862cb)
and then a modified version of the patch was landed in the upstream codebase.
Check out the discussion in openzfs/openzfs#24 .

This commit aligns ZoL with OpenZFS codebase.
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

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

LGTM. The updated comment clarifying the history of this looks good.

@behlendorf
Copy link
Contributor

@dweeezil the update PR LGTM and just brings us inline with the upstream version of the fix. But can you look it over and approve the patch to make sure I didn't overlook something.

Copy link
Contributor

@dweeezil dweeezil left a comment

Choose a reason for hiding this comment

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

This LGTM. It aligns properly with the upstream code and accomplishes the same as the existing fix.

@dweeezil
Copy link
Contributor

The commit comment is malformed. It needs a blank line.

@behlendorf
Copy link
Contributor

@dweeezil thanks for the double check. I can fix the comment when merging this.

@behlendorf behlendorf merged commit 76fe529 into openzfs:master Jan 19, 2017
@gmelikov
Copy link
Member Author

@dweeezil @behlendorf thanks for help!

@gmelikov gmelikov deleted the OpenZFS-6529 branch January 19, 2017 22:39
wli5 pushed a commit to wli5/zfs that referenced this pull request Feb 28, 2017
Porting notes:
- This issue was first fixed in ZoL by commit d862cb0d.  That fix was
then modified and an equivalent version of the patch landed in the
upstream code base.  For additional details see the discussion in
openzfs/openzfs#24 .

This commit aligns ZoL with OpenZFS codebase.

Authored by: Andriy Gapon <avg@icyb.net.ua>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Ported-by: George Melikov mail@gmelikov.ru

OpenZFS-issue: https://www.illumos.org/issues/6529
OpenZFS-commit: openzfs/openzfs@e7e978b
Closes openzfs#5606
wli5 pushed a commit to wli5/zfs that referenced this pull request Feb 28, 2017
Porting notes:
- This issue was first fixed in ZoL by commit d862cb0d.  That fix was
then modified and an equivalent version of the patch landed in the
upstream code base.  For additional details see the discussion in
openzfs/openzfs#24 .

This commit aligns ZoL with OpenZFS codebase.

Authored by: Andriy Gapon <avg@icyb.net.ua>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Ported-by: George Melikov mail@gmelikov.ru

OpenZFS-issue: https://www.illumos.org/issues/6529
OpenZFS-commit: openzfs/openzfs@e7e978b
Closes openzfs#5606
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.

None yet

5 participants