mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
Illumos 5027 - zfs large block support
5027 zfs large block support Reviewed by: Alek Pinchuk <pinchuk.alek@gmail.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Richard Elling <richard.elling@richardelling.com> Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com> Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Approved by: Dan McDonald <danmcd@omniti.com> References: https://www.illumos.org/issues/5027 https://github.com/illumos/illumos-gate/commit/b515258 Porting Notes: * Included in this patch is a tiny ISP2() cleanup in zio_init() from Illumos 5255. * Unlike the upstream Illumos commit this patch does not impose an arbitrary 128K block size limit on volumes. Volumes, like filesystems, are limited by the zfs_max_recordsize=1M module option. * By default the maximum record size is limited to 1M by the module option zfs_max_recordsize. This value may be safely increased up to 16M which is the largest block size supported by the on-disk format. At the moment, 1M blocks clearly offer a significant performance improvement but the benefits of going beyond this for the majority of workloads are less clear. * The illumos version of this patch increased DMU_MAX_ACCESS to 32M. This was determined not to be large enough when using 16M blocks because the zfs_make_xattrdir() function will fail (EFBIG) when assigning a TX. This was immediately observed under Linux because all newly created files must have a security xattr created and that was failing. Therefore, we've set DMU_MAX_ACCESS to 64M. * On 32-bit platforms a hard limit of 1M is set for blocks due to the limited virtual address space. We should be able to relax this one the ABD patches are merged. Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #354
This commit is contained in:
committed by
Brian Behlendorf
parent
3df293404a
commit
f1512ee61e
+22
-4
@@ -266,6 +266,14 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp)
|
||||
spa_prop_add_list(*nvp, ZPOOL_PROP_ALTROOT, spa->spa_root,
|
||||
0, ZPROP_SRC_LOCAL);
|
||||
|
||||
if (spa_feature_is_enabled(spa, SPA_FEATURE_LARGE_BLOCKS)) {
|
||||
spa_prop_add_list(*nvp, ZPOOL_PROP_MAXBLOCKSIZE, NULL,
|
||||
MIN(zfs_max_recordsize, SPA_MAXBLOCKSIZE), ZPROP_SRC_NONE);
|
||||
} else {
|
||||
spa_prop_add_list(*nvp, ZPOOL_PROP_MAXBLOCKSIZE, NULL,
|
||||
SPA_OLD_MAXBLOCKSIZE, ZPROP_SRC_NONE);
|
||||
}
|
||||
|
||||
if ((dp = list_head(&spa->spa_config_list)) != NULL) {
|
||||
if (dp->scd_path == NULL) {
|
||||
spa_prop_add_list(*nvp, ZPOOL_PROP_CACHEFILE,
|
||||
@@ -482,7 +490,7 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
|
||||
|
||||
if (!error) {
|
||||
objset_t *os;
|
||||
uint64_t compress;
|
||||
uint64_t propval;
|
||||
|
||||
if (strval == NULL || strval[0] == '\0') {
|
||||
objnum = zpool_prop_default_numeric(
|
||||
@@ -494,15 +502,25 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
|
||||
if (error)
|
||||
break;
|
||||
|
||||
/* Must be ZPL and not gzip compressed. */
|
||||
/*
|
||||
* Must be ZPL, and its property settings
|
||||
* must be supported by GRUB (compression
|
||||
* is not gzip, and large blocks are not used).
|
||||
*/
|
||||
|
||||
if (dmu_objset_type(os) != DMU_OST_ZFS) {
|
||||
error = SET_ERROR(ENOTSUP);
|
||||
} else if ((error =
|
||||
dsl_prop_get_int_ds(dmu_objset_ds(os),
|
||||
zfs_prop_to_name(ZFS_PROP_COMPRESSION),
|
||||
&compress)) == 0 &&
|
||||
!BOOTFS_COMPRESS_VALID(compress)) {
|
||||
&propval)) == 0 &&
|
||||
!BOOTFS_COMPRESS_VALID(propval)) {
|
||||
error = SET_ERROR(ENOTSUP);
|
||||
} else if ((error =
|
||||
dsl_prop_get_int_ds(dmu_objset_ds(os),
|
||||
zfs_prop_to_name(ZFS_PROP_RECORDSIZE),
|
||||
&propval)) == 0 &&
|
||||
propval > SPA_OLD_MAXBLOCKSIZE) {
|
||||
error = SET_ERROR(ENOTSUP);
|
||||
} else {
|
||||
objnum = dmu_objset_id(os);
|
||||
|
||||
Reference in New Issue
Block a user