Bug #3944
closedlibtopo zfs module will clobber libzfs handle when an instance of the module unloads
100%
Description
The problem here is that g_zfs global gets clobbered by other instances of the module doing a zfs_fini() - setting g_zfs to NULL.
see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/fm/topo/libtopo/common/zfs.c#62
impact of this bug is that when g_zfs is NULL we get the wrong ASRU/FMRI string being generated which in turn will cause some corresponding FMA event(s) to not be cleared (see http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/fm/topo/libtopo/common/zfs.c#158 & http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/fm/modules/common/zfs-retire/zfs_retire.c#275).
you can use the "echo g_zfs/X |mdb -p `pgrep fmd`" command to check if you are in this state where g_zfs is zeroed out.
The proposed fix adds a refcount so that g_zfs doesn't get freed unless no one is using it.
This way when a module instance unloads it doesn't set g_zfs to NULL for all other instances.
Updated by Alek Pinchuk over 9 years ago
- File 3944.diff added
Updated by Dan McDonald over 9 years ago
- Status changed from In Progress to Pending RTI
- % Done changed from 80 to 100
commit 2227b8ad8ebd0984a34b696ce07145248700852b
Author: Alek Pinchuk <alek@nexenta.com>
Date: Mon Aug 5 16:31:36 2013 -0700
3944 libtopo zfs module will clobber libzfs handle when an instance of the module unloads
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Boris Protopopov <boris.protopopov@nexenta.com>
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Approved by: Dan McDonald <danmcd@nexenta.com>
Updated by Dan McDonald over 9 years ago
- Status changed from Pending RTI to Resolved