Print this page
6220 memleak in l2arc on debug build

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/arc.c
          +++ new/usr/src/uts/common/fs/zfs/arc.c
↓ open down ↓ 1293 lines elided ↑ open up ↑
1294 1294  
1295 1295                  /*
1296 1296                   * A buffer must not be moved into the arc_l2c_only
1297 1297                   * state if it's not finished being written out to the
1298 1298                   * l2arc device. Otherwise, the b_l1hdr.b_tmp_cdata field
1299 1299                   * might try to be accessed, even though it was removed.
1300 1300                   */
1301 1301                  VERIFY(!HDR_L2_WRITING(hdr));
1302 1302                  VERIFY3P(hdr->b_l1hdr.b_tmp_cdata, ==, NULL);
1303 1303  
     1304 +#ifdef ZFS_DEBUG
     1305 +                if (hdr->b_l1hdr.b_thawed != NULL) {
     1306 +                        kmem_free(hdr->b_l1hdr.b_thawed, 1);
     1307 +                        hdr->b_l1hdr.b_thawed = NULL;
     1308 +                }
     1309 +#endif
     1310 +
1304 1311                  nhdr->b_flags &= ~ARC_FLAG_HAS_L1HDR;
1305 1312          }
1306 1313          /*
1307 1314           * The header has been reallocated so we need to re-insert it into any
1308 1315           * lists it was on.
1309 1316           */
1310 1317          (void) buf_hash_insert(nhdr, NULL);
1311 1318  
1312 1319          ASSERT(list_link_active(&hdr->b_l2hdr.b_l2node));
1313 1320  
↓ open down ↓ 5239 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX