Project

General

Profile

Actions

Bug #3944

closed

libtopo zfs module will clobber libzfs handle when an instance of the module unloads

Added by Alek Pinchuk over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Start date:
2013-07-29
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

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.

Actions #1

Updated by Alek Pinchuk over 9 years ago

  • Status changed from New to In Progress
Actions #2

Updated by Alek Pinchuk over 9 years ago

  • File 3944.diff added
Actions #3

Updated by Alek Pinchuk over 9 years ago

  • File deleted (3944.diff)
Actions #4

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 <>
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 &lt;&gt;
Reviewed by: Boris Protopopov &lt;&gt;
Reviewed by: Gary Mills &lt;&gt;
Reviewed by: Joshua M. Clulow &lt;&gt;
Approved by: Dan McDonald &lt;&gt;
Actions #5

Updated by Dan McDonald over 9 years ago

  • Status changed from Pending RTI to Resolved
Actions

Also available in: Atom PDF