ahrens commented on this pull request.
> + */
+static void
+zfs_dispatch_mount(libzfs_handle_t *hdl, zfs_handle_t **handles,
+ size_t num_handles, int idx, zfs_iter_f func, void *data, taskq_t *tq)
+{
+ mnt_param_t *mnt_param = zfs_alloc(hdl, sizeof (mnt_param_t));
+
+ mnt_param->mnt_hdl = hdl;
+ mnt_param->mnt_tq = tq;
+ mnt_param->mnt_zhps = handles;
+ mnt_param->mnt_num_handles = num_handles;
+ mnt_param->mnt_idx = idx;
+ mnt_param->mnt_func = func;
+ mnt_param->mnt_data = data;
+
+ (void) taskq_dispatch(tq, zfs_mount_task, (void*)mnt_param, TQ_SLEEP);
>From looking at the code, if libzfs_printerr is set then libzfs will call
>exit() on memory allocation failure. This is not set by default, but it is
>set by the zfs, zpool, zinject, libshare, dumpadm, and swap commands. So for
>the common ways of hitting this code ("zfs mount", "zfs share", "zpool
>import"), libzfs_printerr will be set, indicating that the desired behavior is
>to exit. The only caller of this code that might not have libzfs_printerr set
>is syseventd (it does this when a pool goes from being FAULTED (or worse) to
>DEGRADED or HEALTHY).
In practice, it looks like lots of (but not all) callers are assuming that we
will die if allocation fails (see callers of no_memory(), like zfs_alloc() and
the comments above them - the assume that libzfs_printerr is always set so we
always exit on failure).
So I'd say this is in keeping with the current behavior of handling allocation
failures poorly :-(
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/536#discussion_r167727390
------------------------------------------
openzfs-developer
Archives:
https://openzfs.topicbox.com/groups/developer/discussions/T22334a01fda83bfd-Ma2fd472957defdae8fc6d719
Powered by Topicbox: https://topicbox.com