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 ↓ 1503 lines elided ↑ open up ↑
1504 1504  
1505 1505          /*
1506 1506           * Call vdev_validate() here to make sure we have the same device.
1507 1507           * Otherwise, a device with an invalid label could be successfully
1508 1508           * opened in response to vdev_reopen().
1509 1509           */
1510 1510          if (vd->vdev_aux) {
1511 1511                  (void) vdev_validate_aux(vd);
1512 1512                  if (vdev_readable(vd) && vdev_writeable(vd) &&
1513 1513                      vd->vdev_aux == &spa->spa_l2cache &&
1514      -                    !l2arc_vdev_present(vd))
1515      -                        l2arc_add_vdev(spa, vd);
     1514 +                    !l2arc_vdev_present(vd)) {
     1515 +                        /*
     1516 +                         * When reopening we can assume persistent L2ARC is
     1517 +                         * supported, since we've already opened the device
     1518 +                         * in the past and prepended an L2 uberblock.
     1519 +                         */
     1520 +                        l2arc_add_vdev(spa, vd, B_TRUE);
     1521 +                }
1516 1522          } else {
1517 1523                  (void) vdev_validate(vd, B_TRUE);
1518 1524          }
1519 1525  
1520 1526          /*
1521 1527           * Reassess parent vdev's health.
1522 1528           */
1523 1529          vdev_propagate_state(vd);
1524 1530  }
1525 1531  
↓ open down ↓ 1674 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX