Date: Fri, 28 May 2010 07:34:20 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208610 - head/sys/boot/zfs Message-ID: <201005280734.o4S7YKFB023581@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Fri May 28 07:34:20 2010 New Revision: 208610 URL: http://svn.freebsd.org/changeset/base/208610 Log: 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 MFC after: 10 days Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Fri May 28 06:49:57 2010 (r208609) +++ head/sys/boot/zfs/zfsimpl.c Fri May 28 07:34:20 2010 (r208610) @@ -958,12 +958,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); @@ -994,9 +999,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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005280734.o4S7YKFB023581>