@@ -1669,10 +1669,10 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags,
1669
1669
* parent's rwlock, which would be a lock ordering violation.
1670
1670
*/
1671
1671
dmu_buf_unlock_parent (db , dblt , tag );
1672
- ( void ) arc_read (zio , db -> db_objset -> os_spa , bpp ,
1672
+ return ( arc_read (zio , db -> db_objset -> os_spa , bpp ,
1673
1673
dbuf_read_done , db , ZIO_PRIORITY_SYNC_READ , zio_flags ,
1674
- & aflags , & zb );
1675
- return ( err );
1674
+ & aflags , & zb )) ;
1675
+
1676
1676
early_unlock :
1677
1677
DB_DNODE_EXIT (db );
1678
1678
mutex_exit (& db -> db_mtx );
@@ -1759,7 +1759,7 @@ dbuf_fix_old_data(dmu_buf_impl_t *db, uint64_t txg)
1759
1759
}
1760
1760
1761
1761
int
1762
- dbuf_read (dmu_buf_impl_t * db , zio_t * zio , uint32_t flags )
1762
+ dbuf_read (dmu_buf_impl_t * db , zio_t * pio , uint32_t flags )
1763
1763
{
1764
1764
int err = 0 ;
1765
1765
boolean_t prefetch ;
@@ -1822,13 +1822,13 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
1822
1822
1823
1823
db_lock_type_t dblt = dmu_buf_lock_parent (db , RW_READER , FTAG );
1824
1824
1825
- if (zio == NULL && (db -> db_state == DB_NOFILL ||
1825
+ if (pio == NULL && (db -> db_state == DB_NOFILL ||
1826
1826
(db -> db_blkptr != NULL && !BP_IS_HOLE (db -> db_blkptr )))) {
1827
1827
spa_t * spa = dn -> dn_objset -> os_spa ;
1828
- zio = zio_root (spa , NULL , NULL , ZIO_FLAG_CANFAIL );
1828
+ pio = zio_root (spa , NULL , NULL , ZIO_FLAG_CANFAIL );
1829
1829
need_wait = B_TRUE ;
1830
1830
}
1831
- err = dbuf_read_impl (db , zio , flags , dblt , FTAG );
1831
+ err = dbuf_read_impl (db , pio , flags , dblt , FTAG );
1832
1832
/*
1833
1833
* dbuf_read_impl has dropped db_mtx and our parent's rwlock
1834
1834
* for us
@@ -1849,9 +1849,10 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
1849
1849
*/
1850
1850
if (need_wait ) {
1851
1851
if (err == 0 )
1852
- err = zio_wait (zio );
1852
+ err = zio_wait (pio );
1853
1853
else
1854
- VERIFY0 (zio_wait (zio ));
1854
+ (void ) zio_wait (pio );
1855
+ pio = NULL ;
1855
1856
}
1856
1857
} else {
1857
1858
/*
@@ -1878,7 +1879,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
1878
1879
ASSERT (db -> db_state == DB_READ ||
1879
1880
(flags & DB_RF_HAVESTRUCT ) == 0 );
1880
1881
DTRACE_PROBE2 (blocked__read , dmu_buf_impl_t * ,
1881
- db , zio_t * , zio );
1882
+ db , zio_t * , pio );
1882
1883
cv_wait (& db -> db_changed , & db -> db_mtx );
1883
1884
}
1884
1885
if (db -> db_state == DB_UNCACHED )
@@ -1887,6 +1888,13 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
1887
1888
}
1888
1889
}
1889
1890
1891
+ if (pio && err != 0 ) {
1892
+ zio_t * zio = zio_null (pio , pio -> io_spa , NULL , NULL , NULL ,
1893
+ ZIO_FLAG_CANFAIL );
1894
+ zio -> io_error = err ;
1895
+ zio_nowait (zio );
1896
+ }
1897
+
1890
1898
return (err );
1891
1899
}
1892
1900
0 commit comments