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:
avg 2015-06-05 15:32:04 +00:00
parent 6e44f70c4f
commit 7ef0c0eeca

View File

@ -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);