zectl icon indicating copy to clipboard operation
zectl copied to clipboard

Remove zfs_iter_filesystems from libze_activate and libze_clone

Open umsaleem opened this issue 3 years ago • 0 comments

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.

umsaleem avatar Sep 16 '22 13:09 umsaleem