Mercurial > illumos > illumos-gate
comparison usr/src/uts/common/fs/zfs/dsl_scan.c @ 13941:d48547176ab4
3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
author | George Wilson <george.wilson@delphix.com> |
---|---|
date | Fri, 01 Feb 2013 14:11:09 -0800 |
parents | 9410cf539b11 |
children | 7a22d0770fc8 |
comparison
equal
deleted
inserted
replaced
13940:e2277f14d676 | 13941:d48547176ab4 |
---|---|
364 { | 364 { |
365 ASSERT(dsl_pool_sync_context(dp)); | 365 ASSERT(dsl_pool_sync_context(dp)); |
366 zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags)); | 366 zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags)); |
367 } | 367 } |
368 | 368 |
369 int | |
370 dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf, | |
371 arc_done_func_t *done, void *private, int priority, int zio_flags, | |
372 uint32_t *arc_flags, const zbookmark_t *zb) | |
373 { | |
374 return (arc_read(pio, spa, bpp, pbuf, done, private, | |
375 priority, zio_flags, arc_flags, zb)); | |
376 } | |
377 | |
378 int | |
379 dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp, | |
380 arc_done_func_t *done, void *private, int priority, int zio_flags, | |
381 uint32_t *arc_flags, const zbookmark_t *zb) | |
382 { | |
383 return (arc_read_nolock(pio, spa, bpp, done, private, | |
384 priority, zio_flags, arc_flags, zb)); | |
385 } | |
386 | |
387 static uint64_t | 369 static uint64_t |
388 dsl_scan_ds_maxtxg(dsl_dataset_t *ds) | 370 dsl_scan_ds_maxtxg(dsl_dataset_t *ds) |
389 { | 371 { |
390 uint64_t smt = ds->ds_dir->dd_pool->dp_scan->scn_phys.scn_max_txg; | 372 uint64_t smt = ds->ds_dir->dd_pool->dp_scan->scn_phys.scn_max_txg; |
391 if (dsl_dataset_is_snapshot(ds)) | 373 if (dsl_dataset_is_snapshot(ds)) |
552 (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE)) | 534 (BP_GET_LEVEL(bp) == 0 && BP_GET_TYPE(bp) != DMU_OT_DNODE)) |
553 return; | 535 return; |
554 | 536 |
555 SET_BOOKMARK(&czb, objset, object, BP_GET_LEVEL(bp), blkid); | 537 SET_BOOKMARK(&czb, objset, object, BP_GET_LEVEL(bp), blkid); |
556 | 538 |
557 /* | |
558 * XXX need to make sure all of these arc_read() prefetches are | |
559 * done before setting xlateall (similar to dsl_read()) | |
560 */ | |
561 (void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, bp, | 539 (void) arc_read(scn->scn_zio_root, scn->scn_dp->dp_spa, bp, |
562 buf, NULL, NULL, ZIO_PRIORITY_ASYNC_READ, | 540 NULL, NULL, ZIO_PRIORITY_ASYNC_READ, |
563 ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD, &flags, &czb); | 541 ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD, &flags, &czb); |
564 } | 542 } |
565 | 543 |
566 static boolean_t | 544 static boolean_t |
567 dsl_scan_check_resume(dsl_scan_t *scn, const dnode_phys_t *dnp, | 545 dsl_scan_check_resume(dsl_scan_t *scn, const dnode_phys_t *dnp, |
615 uint32_t flags = ARC_WAIT; | 593 uint32_t flags = ARC_WAIT; |
616 int i; | 594 int i; |
617 blkptr_t *cbp; | 595 blkptr_t *cbp; |
618 int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; | 596 int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT; |
619 | 597 |
620 err = arc_read_nolock(NULL, dp->dp_spa, bp, | 598 err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, |
621 arc_getbuf_func, bufp, | |
622 ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); | 599 ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); |
623 if (err) { | 600 if (err) { |
624 scn->scn_phys.scn_errors++; | 601 scn->scn_phys.scn_errors++; |
625 return (err); | 602 return (err); |
626 } | 603 } |
638 *bufp, ds, scn, ostype, tx); | 615 *bufp, ds, scn, ostype, tx); |
639 } | 616 } |
640 } else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) { | 617 } else if (BP_GET_TYPE(bp) == DMU_OT_USERGROUP_USED) { |
641 uint32_t flags = ARC_WAIT; | 618 uint32_t flags = ARC_WAIT; |
642 | 619 |
643 err = arc_read_nolock(NULL, dp->dp_spa, bp, | 620 err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, |
644 arc_getbuf_func, bufp, | |
645 ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); | 621 ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); |
646 if (err) { | 622 if (err) { |
647 scn->scn_phys.scn_errors++; | 623 scn->scn_phys.scn_errors++; |
648 return (err); | 624 return (err); |
649 } | 625 } |
651 uint32_t flags = ARC_WAIT; | 627 uint32_t flags = ARC_WAIT; |
652 dnode_phys_t *cdnp; | 628 dnode_phys_t *cdnp; |
653 int i, j; | 629 int i, j; |
654 int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT; | 630 int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT; |
655 | 631 |
656 err = arc_read_nolock(NULL, dp->dp_spa, bp, | 632 err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, |
657 arc_getbuf_func, bufp, | |
658 ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); | 633 ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); |
659 if (err) { | 634 if (err) { |
660 scn->scn_phys.scn_errors++; | 635 scn->scn_phys.scn_errors++; |
661 return (err); | 636 return (err); |
662 } | 637 } |
674 | 649 |
675 } else if (BP_GET_TYPE(bp) == DMU_OT_OBJSET) { | 650 } else if (BP_GET_TYPE(bp) == DMU_OT_OBJSET) { |
676 uint32_t flags = ARC_WAIT; | 651 uint32_t flags = ARC_WAIT; |
677 objset_phys_t *osp; | 652 objset_phys_t *osp; |
678 | 653 |
679 err = arc_read_nolock(NULL, dp->dp_spa, bp, | 654 err = arc_read(NULL, dp->dp_spa, bp, arc_getbuf_func, bufp, |
680 arc_getbuf_func, bufp, | |
681 ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); | 655 ZIO_PRIORITY_ASYNC_READ, zio_flags, &flags, zb); |
682 if (err) { | 656 if (err) { |
683 scn->scn_phys.scn_errors++; | 657 scn->scn_phys.scn_errors++; |
684 return (err); | 658 return (err); |
685 } | 659 } |