Project

General

Profile

Bug #4128

disks in zpools never go away when pulled

Added by Robert Mustacchi about 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Category:
kernel
Start date:
2013-09-14
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

ZFS uses ldi_open_by_devid(9F), et al, to gain access to block devices when importing a pool. This bumps the devi_ref member of the opened device node, so that it doesn't become unreferenced (and thus freed) while we have it open. Unfortunately, very little will cause ZFS to actually close its LDI handle, and leave it closed; least of all with timing adequate to effect device removal.

As it turns out, LDI provides a basic facility for notifying the owner of an open handle that the device has been offlined (or otherwise faulted, removed, etc). This should really not be considered optional, as correct operation of device removal seems impossible without it. Regardless, ZFS needs to listen for these events and close its LDI handle at appropriate moments.

In addition to closing the device handle, we should also update the state of the vdev that was using the device to be REMOVED.

History

#1

Updated by Robert Mustacchi almost 6 years ago

  • % Done changed from 90 to 100
  • Status changed from New to Resolved

Resolved in 39cddb10a31c1c2e66aed69e6871d09caa4c8147.

Also available in: Atom PDF