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

Remove zfs_iter_filesystems from libze_activate and libze_clone #48

Merged
merged 1 commit into from
Oct 29, 2022

Conversation

usaleem-ix
Copy link
Contributor

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.

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.

Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
@johnramsden johnramsden merged commit 03e364b into johnramsden:master Oct 29, 2022
@yocalebo yocalebo deleted the NAS-117752-1 branch November 19, 2024 14:56
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.

2 participants