Print this page
3909 Fix hang when sending dedup stream

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_sendrecv.c
          +++ new/usr/src/lib/libzfs/common/libzfs_sendrecv.c
↓ open down ↓ 1558 lines elided ↑ open up ↑
1559 1559          fsavl_destroy(fsavl);
1560 1560          nvlist_free(fss);
1561 1561  
1562 1562          /* Ensure no snaps found is treated as an error. */
1563 1563          if (err == 0 && !sdd.seento)
1564 1564                  err = ENOENT;
1565 1565  
1566 1566          if (tid != 0) {
1567 1567                  if (err != 0)
1568 1568                          (void) pthread_cancel(tid);
1569      -                (void) pthread_join(tid, NULL);
1570 1569                  (void) close(pipefd[0]);
     1570 +                (void) pthread_join(tid, NULL);
1571 1571          }
1572 1572  
1573 1573          if (sdd.cleanup_fd != -1) {
1574 1574                  VERIFY(0 == close(sdd.cleanup_fd));
1575 1575                  sdd.cleanup_fd = -1;
1576 1576          }
1577 1577  
1578 1578          if (!flags->dryrun && (flags->replicate || flags->doall ||
1579 1579              flags->props)) {
1580 1580                  /*
↓ open down ↓ 15 lines elided ↑ open up ↑
1596 1596          err = zfs_standard_error(zhp->zfs_hdl, err, errbuf);
1597 1597  err_out:
1598 1598          fsavl_destroy(fsavl);
1599 1599          nvlist_free(fss);
1600 1600          fnvlist_free(sdd.snapholds);
1601 1601  
1602 1602          if (sdd.cleanup_fd != -1)
1603 1603                  VERIFY(0 == close(sdd.cleanup_fd));
1604 1604          if (tid != 0) {
1605 1605                  (void) pthread_cancel(tid);
1606      -                (void) pthread_join(tid, NULL);
1607 1606                  (void) close(pipefd[0]);
     1607 +                (void) pthread_join(tid, NULL);
1608 1608          }
1609 1609          return (err);
1610 1610  }
1611 1611  
1612 1612  /*
1613 1613   * Routines specific to "zfs recv"
1614 1614   */
1615 1615  
1616 1616  static int
1617 1617  recv_read(libzfs_handle_t *hdl, int fd, void *buf, int ilen,
↓ open down ↓ 1607 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX