dnode_read: handle hole blocks in zfs boot code
A hole block pointer can be encountered at any level and the hole can cover multiple data blocks, but we are reading the data blocks one by one, so we care only about the current one. PR: 199804 Reported by: Toomas Soome <tsoome@me.com> Submitted by: Toomas Soome <tsoome@me.com> (earlier version) Tested by: Toomas Soome <tsoome@me.com> MFC after: 11 days
This commit is contained in:
parent
2764d3bcdb
commit
dade6e27ab
@ -1255,6 +1255,10 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf,
|
||||
ibn = bn >> ((nlevels - i - 1) * ibshift);
|
||||
ibn &= ((1 << ibshift) - 1);
|
||||
bp = indbp[ibn];
|
||||
if (BP_IS_HOLE(bp)) {
|
||||
memset(dnode_cache_buf, 0, bsize);
|
||||
break;
|
||||
}
|
||||
rc = zio_read(spa, &bp, dnode_cache_buf);
|
||||
if (rc)
|
||||
return (rc);
|
||||
|
Loading…
Reference in New Issue
Block a user