So I ran it under gdb and set a breakpoint to find how unmount_cb() is being called and traced the problem back up to unuse_data_iterate(). It calls gdu_utils_is_in_use_full(), which incorrectly identifies the mount point of the filesystem as "/". So it looks like either it is finding the wrong mount point for the filesystem and trying to unmount the root ( which you obviously can't do ), or unuse_data_iterate() is actually being called on the root filesystem instead of the one you are trying to resize. Unfortunately I can't tell which since almost all of the data this code is working with gdb tells me has an incomplete type.
So I ran it under gdb and set a breakpoint to find how unmount_cb() is being called and traced the problem back up to unuse_data_ iterate( ). It calls gdu_utils_ is_in_use_ full(), which incorrectly identifies the mount point of the filesystem as "/". So it looks like either it is finding the wrong mount point for the filesystem and trying to unmount the root ( which you obviously can't do ), or unuse_data_ iterate( ) is actually being called on the root filesystem instead of the one you are trying to resize. Unfortunately I can't tell which since almost all of the data this code is working with gdb tells me has an incomplete type.