]> git.proxmox.com Git - mirror_zfs.git/commit
vdev_ashift should only be set once
authorGeorge Wilson <george.wilson@delphix.com>
Fri, 18 Sep 2020 19:13:47 +0000 (14:13 -0500)
committerGitHub <noreply@github.com>
Fri, 18 Sep 2020 19:13:47 +0000 (12:13 -0700)
commitc494aa7f578d5cb844b770f679bd46495242edad
tree6abcc94bc41285c5157817062b600c81986b5e7e
parent908d43d0a9f736af62c0f4b179950bb1262dfd7d
vdev_ashift should only be set once

== Motivation and Context

The new vdev ashift optimization prevents the removal of devices when
a zfs configuration is comprised of disks which have different logical
and physical block sizes. This is caused because we set 'spa_min_ashift'
in vdev_open and then later call 'vdev_ashift_optimize'. This would
result in an inconsistency between spa's ashift calculations and that
of the top-level vdev.

In addition, the optimization logical ignores the overridden ashift
value that would be provided by '-o ashift=<val>'.

== Description

This change reworks the vdev ashift optimization so that it's only
set the first time the device is configured. It still allows the
physical and logical ahsift values to be set every time the device
is opened but those values are only consulted on first open.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Cedric Berger <cedric@precidata.com>
Signed-off-by: George Wilson <gwilson@delphix.com>
External-Issue: DLPX-71831
Closes #10932
19 files changed:
cmd/zpool/zpool_main.c
include/os/linux/kernel/linux/mod_compat.h
include/sys/vdev.h
man/man5/zfs-module-parameters.5
module/os/freebsd/zfs/sysctl_os.c
module/os/freebsd/zfs/vdev_file.c
module/os/linux/zfs/vdev_file.c
module/zfs/arc.c
module/zfs/spa.c
module/zfs/spa_config.c
module/zfs/vdev.c
module/zfs/vdev_mirror.c
tests/zfs-tests/include/tunables.cfg
tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh