forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update sa_lengths properly when replacing variable-size SA.
When updating a SA, the sa_lengths array is used to track the sizes of all variable-sized SAs. It had not been properly updated when copying an already-existing variable-sized SA. This didn't come up too often because variable-sized SAs are relatively rare. Fixes openzfs#1978.
- Loading branch information
Showing
1 changed file
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit 734d677
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst we're here... this part a bit further down also looks odd:
if (action == SA_ADD) {
length = SA_REGISTERED_LEN(sa, newattr);
if (length == 0) {
length = buflen;
}
SA_ADD_BULK_ATTR(attr_desc, j, newattr, locator,
datastart, buflen);
}
Once again length
isn't used?? I.e. the above is equivalent to:
if (action == SA_ADD) {
SA_ADD_BULK_ATTR(attr_desc, j, newattr, locator,
datastart, buflen);
}
I run with asserts enabled and I've not hit that ASSERT() - and
length
isn't used. Is that some debugging that's leaked into the patch? Otherwise, if the ASSERT() shouldn't be there, then the line can be removed altogether?