Print this page
3525 Persistent L2ARC

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/vdev.c
          +++ new/usr/src/uts/common/fs/zfs/vdev.c
↓ open down ↓ 1497 lines elided ↑ open up ↑
1498 1498  
1499 1499          /*
1500 1500           * Call vdev_validate() here to make sure we have the same device.
1501 1501           * Otherwise, a device with an invalid label could be successfully
1502 1502           * opened in response to vdev_reopen().
1503 1503           */
1504 1504          if (vd->vdev_aux) {
1505 1505                  (void) vdev_validate_aux(vd);
1506 1506                  if (vdev_readable(vd) && vdev_writeable(vd) &&
1507 1507                      vd->vdev_aux == &spa->spa_l2cache &&
1508      -                    !l2arc_vdev_present(vd))
1509      -                        l2arc_add_vdev(spa, vd);
     1508 +                    !l2arc_vdev_present(vd)) {
     1509 +                        /*
     1510 +                         * When reopening we can assume persistent L2ARC is
     1511 +                         * supported, since we've already opened the device
     1512 +                         * in the past and prepended an L2ARC uberblock.
     1513 +                         */
     1514 +                        l2arc_add_vdev(spa, vd, B_TRUE);
     1515 +                }
1510 1516          } else {
1511 1517                  (void) vdev_validate(vd, B_TRUE);
1512 1518          }
1513 1519  
1514 1520          /*
1515 1521           * Reassess parent vdev's health.
1516 1522           */
1517 1523          vdev_propagate_state(vd);
1518 1524  }
1519 1525  
↓ open down ↓ 1783 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX