FreeBSD Bugzilla – Attachment 112302 Details for
Bug 153695
[patch] [zfs] Booting from zpool created on 4k-sector drive doesn't work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.88 KB, created by
Emil Smolenski
on 2011-01-04 23:50:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Emil Smolenski
Created:
2011-01-04 23:50:09 UTC
Size:
1.88 KB
patch
obsolete
>diff -ruN sys.orig/boot/zfs/zfsimpl.c sys/boot/zfs/zfsimpl.c >--- sys.orig/boot/zfs/zfsimpl.c 2010-12-29 13:55:38.195215000 +0100 >+++ sys/boot/zfs/zfsimpl.c 2010-12-29 13:24:39.825206000 +0100 >@@ -770,7 +770,7 @@ > const char *pool_name; > const unsigned char *vdevs; > int i, rc, is_newer; >- char upbuf[1024]; >+ vdev_phys_t upbuf; > const struct uberblock *up; > > /* >@@ -921,21 +921,21 @@ > * the contents of the pool. > */ > for (i = 0; >- i < VDEV_UBERBLOCK_RING >> UBERBLOCK_SHIFT; >+ i < VDEV_UBERBLOCK_COUNT(vdev); > i++) { >- off = offsetof(vdev_label_t, vl_uberblock); >- off += i << UBERBLOCK_SHIFT; >+ off = VDEV_UBERBLOCK_OFFSET(vdev, i); > BP_ZERO(&bp); > DVA_SET_OFFSET(&bp.blk_dva[0], off); >- BP_SET_LSIZE(&bp, 1 << UBERBLOCK_SHIFT); >- BP_SET_PSIZE(&bp, 1 << UBERBLOCK_SHIFT); >+ DVA_SET_ASIZE(&bp.blk_dva[0], VDEV_UBERBLOCK_SIZE(vdev)); >+ BP_SET_LSIZE(&bp, VDEV_UBERBLOCK_SIZE(vdev)); >+ BP_SET_PSIZE(&bp, VDEV_UBERBLOCK_SIZE(vdev)); > BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); > BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); > ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); >- if (vdev_read_phys(vdev, &bp, upbuf, off, 0)) >+ if (vdev_read_phys(vdev, &bp, &upbuf, off, 0)) > continue; > >- up = (const struct uberblock *) upbuf; >+ up = (const struct uberblock *) &upbuf; > if (up->ub_magic != UBERBLOCK_MAGIC) > continue; > if (up->ub_txg < spa->spa_txg) >diff -ruN sys.orig/cddl/boot/zfs/zfsimpl.h sys/cddl/boot/zfs/zfsimpl.h >--- sys.orig/cddl/boot/zfs/zfsimpl.h 2010-12-29 13:55:58.870864000 +0100 >+++ sys/cddl/boot/zfs/zfsimpl.h 2010-12-29 13:24:29.014796000 +0100 >@@ -324,7 +324,7 @@ > #define VDEV_UBERBLOCK_RING (128 << 10) > > #define VDEV_UBERBLOCK_SHIFT(vd) \ >- MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT) >+ MAX((vd)->v_ashift, UBERBLOCK_SHIFT) > #define VDEV_UBERBLOCK_COUNT(vd) \ > (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd)) > #define VDEV_UBERBLOCK_OFFSET(vd, n) \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 153695
: 112302