svn commit: r208893 - stable/7/sys/boot/zfs
Andriy Gapon
avg at FreeBSD.org
Mon Jun 7 13:44:05 UTC 2010
Author: avg
Date: Mon Jun 7 13:44:04 2010
New Revision: 208893
URL: http://svn.freebsd.org/changeset/base/208893
Log:
MFC r208610: boot/zfs: fix gang block reading code
- use correct size (512) while reading a gang block
- skip holes while reading child blocks
- advance buffer pointer while reading child blocks
PR: 144214
Modified:
stable/7/sys/boot/zfs/zfsimpl.c
Directory Properties:
stable/7/sys/ (props changed)
stable/7/sys/cddl/contrib/opensolaris/ (props changed)
stable/7/sys/contrib/dev/acpica/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
Modified: stable/7/sys/boot/zfs/zfsimpl.c
==============================================================================
--- stable/7/sys/boot/zfs/zfsimpl.c Mon Jun 7 13:37:13 2010 (r208892)
+++ stable/7/sys/boot/zfs/zfsimpl.c Mon Jun 7 13:44:04 2010 (r208893)
@@ -914,12 +914,17 @@ zio_read_gang(spa_t *spa, const blkptr_t
break;
if (!vdev || !vdev->v_read)
return (EIO);
- if (vdev->v_read(vdev, bp, &zio_gb, offset, SPA_GANGBLOCKSIZE))
+ if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE))
return (EIO);
for (i = 0; i < SPA_GBH_NBLKPTRS; i++) {
- if (zio_read(spa, &zio_gb.zg_blkptr[i], buf))
+ blkptr_t *gbp = &zio_gb.zg_blkptr[i];
+
+ if (BP_IS_HOLE(gbp))
+ continue;
+ if (zio_read(spa, gbp, buf))
return (EIO);
+ buf = (char*)buf + BP_GET_PSIZE(gbp);
}
return (0);
@@ -950,9 +955,8 @@ zio_read(spa_t *spa, const blkptr_t *bp,
continue;
if (DVA_GET_GANG(dva)) {
- printf("ZFS: gang block detected!\n");
if (zio_read_gang(spa, bp, dva, buf))
- return (EIO);
+ continue;
} else {
vdevid = DVA_GET_VDEV(dva);
offset = DVA_GET_OFFSET(dva);
More information about the svn-src-all
mailing list