Remove zfs_iter_filesystems from libze_activate and libze_clone #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In libze_activate(), libze_activate_cbdata is passed as cbd to zfs_iter_filesystems() with callback function libze_clone_cb(), which interprets it as libze_clone_cbdata. Both libze_activate_cbdata and libze_activate_cbdata have different members. When libze_clone_cb() is invoked during activate and there are any child datasets in BE, segmentation fault is generated because of using incorrect addresses formed when libze_activate_cbdata is interpretted as libze_clone_cbdata. Moreover, properties of child datasets should not be cloned during activate operation, as they are already cloned during create operation.
In libze_clone(), libze_clone_cb() is called, which already performs zfs_iter_filesystems() if recursive flag is set. Calling zfs_iter_filesystems() again from libze_clone() after calling libze_clone_cb() should not be needed.