aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGeorge Amanakis <[email protected]>2023-06-14 17:01:17 +0200
committerGitHub <[email protected]>2023-06-14 08:01:17 -0700
commit8af1104f83eb44501b83218ed456e2d4b0ac3521 (patch)
tree45e2b3294772b218d8e8e8bf47e58d7a9cab547d /module
parentfeff9dfed3df1bbae5dd74959a6ad87d11f27ffb (diff)
Store the L2ARC device ashift in the vdev label
If this is not done, and the pool has an ashift other than the default (at the moment 9) then the following happens: 1) vdev_alloc() assigns the ashift of the pool to L2ARC device, but upon export it is not stored anywhere 2) at the first import, vdev_open() sees an vdev_ashift() of 0 and assigns the logical_ashift, which is 9 3) reading the contents of L2ARC, including the header fails 4) L2ARC buffers are not restored in ARC. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Amanakis <[email protected]> Closes #14313 Closes #14963
Diffstat (limited to 'module')
-rw-r--r--module/zfs/vdev_label.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c
index 85c7134ca..a5c76808f 100644
--- a/module/zfs/vdev_label.c
+++ b/module/zfs/vdev_label.c
@@ -486,6 +486,9 @@ vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats,
if (vd->vdev_isspare)
fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1);
+ if (flags & VDEV_CONFIG_L2CACHE)
+ fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, vd->vdev_ashift);
+
if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE)) &&
vd == vd->vdev_top) {
fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY,