Discussion:
Hard-code ashift=12 patch
(too old to reply)
Gordan Bobic
2014-02-20 12:53:29 UTC
Permalink
I _think_ this does that, but please review and treat with caution until
somebody with more knowledge of ZFS internals says it's OK.

--- src/lib/libzpool/vdev_label.c.orig 2014-02-20 12:02:29.306170588
+0000
+++ src/lib/libzpool/vdev_label.c 2014-02-20 12:02:44.646155572 +0000
@@ -277,7 +277,7 @@
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT,
vd->vdev_ms_shift) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT,
- vd->vdev_ashift) == 0);
+ 12) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE,
vd->vdev_asize) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG,

According to zdb to pool I created with this patch does show up as
ashift=12.

Gordan
--
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-fuse+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Emmanuel Anne
2014-02-20 18:12:35 UTC
Permalink
if it works it's ok.
I think the vdev init for ashift is in vdev_file_open line 136 of
lib/libzpool/vdev_file.c:
*ashift = SPA_MINBLOCKSHIFT;
that's probably here that ashift should normally be modified (default value
here, it shouldn't prevent it from reading other pools with different
ashift values).
Not tested of course.
Post by Gordan Bobic
I _think_ this does that, but please review and treat with caution until
somebody with more knowledge of ZFS internals says it's OK.
--- src/lib/libzpool/vdev_label.c.orig 2014-02-20 12:02:29.306170588
+0000
+++ src/lib/libzpool/vdev_label.c 2014-02-20 12:02:44.646155572 +0000
@@ -277,7 +277,7 @@
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT,
vd->vdev_ms_shift) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT,
- vd->vdev_ashift) == 0);
+ 12) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE,
vd->vdev_asize) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG,
According to zdb to pool I created with this patch does show up as
ashift=12.
Gordan
--
--
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-fuse+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Gordan Bobic
2014-02-21 00:46:19 UTC
Permalink
Hmm, that doesn't appear to have worked. zdb is still reporting the
ashift of the pool I created with the modified package to be 9.

I could shange the SPA_MINBLOCKSHIFT definition to 12, but I think that
would prevent zfs-fuse from importing an existing ashift=9 pool, would
it not?

Gordan
Post by Emmanuel Anne
if it works it's ok.
I think the vdev init for ashift is in vdev_file_open line 136 of
*ashift = SPA_MINBLOCKSHIFT;
that's probably here that ashift should normally be modified (default
value here, it shouldn't prevent it from reading other pools with
different ashift values).
Not tested of course.
I _think_ this does that, but please review and treat with caution
until somebody with more knowledge of ZFS internals says it's OK.
--- src/lib/libzpool/vdev_label.c.orig 2014-02-20
12:02:29.306170588 +0000
+++ src/lib/libzpool/vdev_label.c 2014-02-20 12:02:44.646155572 +0000
@@ -277,7 +277,7 @@
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT,
vd->vdev_ms_shift) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT,
- vd->vdev_ashift) == 0);
+ 12) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE,
vd->vdev_asize) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG,
According to zdb to pool I created with this patch does show up as
ashift=12.
Gordan
--
--
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google
Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/groups/opt_out.
--
--
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-fuse+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Gordan Bobic
2014-02-21 01:17:15 UTC
Permalink
Well that's embarrasing - the reason that hadn't worked was because I
was using the unpatched binaries rather than the new patches ones I just
build. *facepalm*

This mod does indeed work for making newly created pools ashift=12,
after which the same pool is importable with the unpatched zfs-fuse.

It looks good. :)

Gordan
Post by Emmanuel Anne
if it works it's ok.
I think the vdev init for ashift is in vdev_file_open line 136 of
*ashift = SPA_MINBLOCKSHIFT;
that's probably here that ashift should normally be modified (default
value here, it shouldn't prevent it from reading other pools with
different ashift values).
Not tested of course.
I _think_ this does that, but please review and treat with caution
until somebody with more knowledge of ZFS internals says it's OK.
--- src/lib/libzpool/vdev_label.c.orig 2014-02-20
12:02:29.306170588 +0000
+++ src/lib/libzpool/vdev_label.c 2014-02-20 12:02:44.646155572 +0000
@@ -277,7 +277,7 @@
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT,
vd->vdev_ms_shift) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT,
- vd->vdev_ashift) == 0);
+ 12) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE,
vd->vdev_asize) == 0);
VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG,
According to zdb to pool I created with this patch does show up as
ashift=12.
Gordan
--
--
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google
Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/groups/opt_out.
--
--
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-fuse+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...