View | Details | Raw Unified | Return to bug 153695
Collapse All | Expand All

(-)sys/boot/zfs/zfsimpl.c (-8 / +8 lines)
Lines 770-776 Link Here
770
	const char *pool_name;
770
	const char *pool_name;
771
	const unsigned char *vdevs;
771
	const unsigned char *vdevs;
772
	int i, rc, is_newer;
772
	int i, rc, is_newer;
773
	char upbuf[1024];
773
	vdev_phys_t upbuf;
774
	const struct uberblock *up;
774
	const struct uberblock *up;
775
775
776
	/*
776
	/*
Lines 921-941 Link Here
921
	 * the contents of the pool.
921
	 * the contents of the pool.
922
	 */
922
	 */
923
	for (i = 0;
923
	for (i = 0;
924
	     i < VDEV_UBERBLOCK_RING >> UBERBLOCK_SHIFT;
924
	     i < VDEV_UBERBLOCK_COUNT(vdev);
925
	     i++) {
925
	     i++) {
926
		off = offsetof(vdev_label_t, vl_uberblock);
926
		off = VDEV_UBERBLOCK_OFFSET(vdev, i);
927
		off += i << UBERBLOCK_SHIFT;
928
		BP_ZERO(&bp);
927
		BP_ZERO(&bp);
929
		DVA_SET_OFFSET(&bp.blk_dva[0], off);
928
		DVA_SET_OFFSET(&bp.blk_dva[0], off);
930
		BP_SET_LSIZE(&bp, 1 << UBERBLOCK_SHIFT);
929
		DVA_SET_ASIZE(&bp.blk_dva[0], VDEV_UBERBLOCK_SIZE(vdev));
931
		BP_SET_PSIZE(&bp, 1 << UBERBLOCK_SHIFT);
930
		BP_SET_LSIZE(&bp, VDEV_UBERBLOCK_SIZE(vdev));
931
		BP_SET_PSIZE(&bp, VDEV_UBERBLOCK_SIZE(vdev));
932
		BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL);
932
		BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL);
933
		BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF);
933
		BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF);
934
		ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0);
934
		ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0);
935
		if (vdev_read_phys(vdev, &bp, upbuf, off, 0))
935
		if (vdev_read_phys(vdev, &bp, &upbuf, off, 0))
936
			continue;
936
			continue;
937
937
938
		up = (const struct uberblock *) upbuf;
938
		up = (const struct uberblock *) &upbuf;
939
		if (up->ub_magic != UBERBLOCK_MAGIC)
939
		if (up->ub_magic != UBERBLOCK_MAGIC)
940
			continue;
940
			continue;
941
		if (up->ub_txg < spa->spa_txg)
941
		if (up->ub_txg < spa->spa_txg)
(-)sys/cddl/boot/zfs/zfsimpl.h (-1 / +1 lines)
Lines 324-330 Link Here
324
#define	VDEV_UBERBLOCK_RING	(128 << 10)
324
#define	VDEV_UBERBLOCK_RING	(128 << 10)
325
325
326
#define	VDEV_UBERBLOCK_SHIFT(vd)	\
326
#define	VDEV_UBERBLOCK_SHIFT(vd)	\
327
	MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT)
327
	MAX((vd)->v_ashift, UBERBLOCK_SHIFT)
328
#define	VDEV_UBERBLOCK_COUNT(vd)	\
328
#define	VDEV_UBERBLOCK_COUNT(vd)	\
329
	(VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd))
329
	(VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd))
330
#define	VDEV_UBERBLOCK_OFFSET(vd, n)	\
330
#define	VDEV_UBERBLOCK_OFFSET(vd, n)	\

Return to bug 153695