----- Original Message ----- From: "Xin Li"
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 07/10/13 02:02, Dag-Erling Sm?rgrav wrote:
The attached patch causes ZFS to base the minimum transfer size for
a new vdev on the GEOM provider's stripesize (physical sector size)
rather than sectorsize (logical sector size), provided that
stripesize is a power of two larger than sectorsize and smaller
than or equal to VDEV_PAD_SIZE.  This should eliminate the need for
ivoras@'s gnop trick when creating ZFS pools on Advanced Format
drives.

I think there are multiple versions of this (I also have one[1]) but
the concern is that if one creates a pool with ashift=9, and now
ashift=12, the pool gets unimportable.  So there need a way to disable
this behavior.

I've tested my patch in all configurations I can think of including exported
ashift=9 pools being imported, all no issues.

For your example e.g.

# Create a 4K pool (min_create_ashift=4K, dev=512)
test:src> sysctl vfs.zfs.min_create_ashift
vfs.zfs.min_create_ashift: 12
test:src> mdconfig -a -t swap -s 128m -S 512 -u 0
test:src> zpool create mdpool md0
test:src> zdb mdpool | grep ashift
               ashift: 12
               ashift: 12

# Create a 512b pool (min_create_ashift=512, dev=512)
test:src> zpool destroy mdpool
test:src> sysctl vfs.zfs.min_create_ashift=9
vfs.zfs.min_create_ashift: 12 -> 9
test:src> zpool create mdpool md0 test:src> zdb mdpool | grep ashift
               ashift: 9
               ashift: 9

# Import a 512b pool (min_create_ashift=4K, dev=512)
test:src> zpool export mdpool
test:src> sysctl vfs.zfs.min_create_ashift=12
vfs.zfs.min_create_ashift: 9 -> 12
test:src> zpool import mdpool
test:src> zdb mdpool | grep ashift
               ashift: 9
               ashift: 9

# Create a 4K pool (min_create_ashift=512, dev=4K)
test:src> zpool destroy mdpool
test:src> mdconfig -d -u 0
test:src> mdconfig -a -t swap -s 128m -S 4096 -u 0 test:src> sysctl vfs.zfs.min_create_ashift=9
vfs.zfs.min_create_ashift: 12 -> 9
test:src> zpool create mdpool md0
test:src> zdb mdpool | grep ashift
               ashift: 12
               ashift: 12

# Import a 4K pool (min_create_ashift=4K, dev=4K)
test:src> zpool export mdpool
test:src> sysctl vfs.zfs.min_create_ashift=12
vfs.zfs.min_create_ashift: 9 -> 12
test:src> zpool import mdpool
test:src> zdb mdpool | grep ashift
               ashift: 12
               ashift: 12

Another thing (not really related to the automatic detection) is that
we need a way to manually override this setting from command line when
creating the pool, this is under active discussion at Illumos mailing
list right now.

[1]
https://github.com/trueos/trueos/commit/3d2e3a38faad8df4acf442b055c5e98ab873fb26

Yep has been on my list for a while, based on previous discussions on zfs-devel@. I've not had any time recently but I'm following the illumos
thread to see what conclusions they come to.

   Regards
   Steve

================================================
This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it.
In the event of misdirection, illegible or incomplete transmission please 
telephone +44 845 868 1337
or return the E.mail to postmas...@multiplay.co.uk.

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to