Skip to content

Commit

Permalink
Resolve incorrect/missing cache vdev issue
Browse files Browse the repository at this point in the history
  • Loading branch information
evansus committed Jun 15, 2014
1 parent a50495e commit 69dcad8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/vdev_iokit.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ vdev_iokit_open(vdev_t *vd, uint64_t *size,
* been re-cabled, moved, removed, or otherwise.
*/
if (error && vd->vdev_guid != 0) {
error = vdev_iokit_open_by_guid(dvd, checkguid);
error = vdev_iokit_open_by_guid(dvd, vd->vdev_guid);

if (error == 0) {
/* Update vdev_path */
Expand Down

2 comments on commit 69dcad8

@evansus
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rottegift: With this commit and running hotspares.sh -k , here's the result of zpool status when cache devices are missing:

bash-3.2# ./hotspares.sh -k
bash-3.2# zpool export tank
bash-3.2# zfs set readonly=on test/hotspare5
bash-3.2# zpool export test && zpool import test
bash-3.2# zpool import
   pool: tank
     id: 1061413750776334060
  state: ONLINE
 status: One or more devices are missing from the system.
 action: The pool can be imported using its name or numeric identifier.
   see: http://zfsonlinux.org/msg/ZFS-8000-2Q
 config:

        tank         ONLINE
          mirror-0   ONLINE
            disk6s1  ONLINE
            disk7s1  ONLINE
        cache
          disk3s1
          disk5s1
        spares
          disk2s1
          disk8s1
        logs
          mirror-1   ONLINE
            disk3s1  ONLINE
            disk4s1  ONLINE
bash-3.2# zpool import tank
bash-3.2# zpool status tank
  pool: tank
 state: ONLINE
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://zfsonlinux.org/msg/ZFS-8000-2Q
  scan: scrub repaired 0 in 0h0m with 0 errors on Sun Jun 15 17:10:51 2014
config:

        NAME         STATE     READ WRITE CKSUM
        tank         ONLINE       0     0     0
          mirror-0   ONLINE       0     0     0
            disk6s1  ONLINE       0     0     0
            disk7s1  ONLINE       0     0     0
        logs
          mirror-1   ONLINE       0     0     0
            disk3s1  ONLINE       0     0     0
            disk4s1  ONLINE       0     0     0
        cache
          disk3s1    UNAVAIL      0     0     0  cannot open
          disk5s1    ONLINE       0     0     0
        spares
          disk2s1    AVAIL   
          disk8s1    AVAIL   

errors: No known data errors

@rottegift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable.

Please sign in to comment.