Skip to content

Commit

Permalink
An experimental workaround for encryption bug
Browse files Browse the repository at this point in the history
It appears that at least all of my reproducers for that bug require
the objset upgrade logic to trigger, so let's turn that off.

Dropped errata openzfs#4 ZTS test for the moment, since that's going to
VERIFY fail now.

Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
  • Loading branch information
rincebrain committed May 23, 2022
1 parent 2cd0f98 commit 6bd8a97
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/zfs-tests-sanity.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: zfs-tests-sanity
name: zfs-tests-sanity-noerrata4

on:
push:
Expand Down
20 changes: 18 additions & 2 deletions module/zfs/dmu_objset.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ static const int dmu_rescan_dnode_threshold = 1 << DN_MAX_INDBLKSHIFT;

static const char *upgrade_tag = "upgrade_tag";

/*
* No quota upgrade triggering allowed.
*/
static int dmu_objset_no_upgrades = 1;

static void dmu_objset_find_dp_cb(void *arg);

static void dmu_objset_upgrade(objset_t *os, dmu_objset_upgrade_cb_t cb);
Expand Down Expand Up @@ -818,8 +823,9 @@ dmu_objset_own(const char *name, dmu_objset_type_t type,
* speed up pool import times and to keep this txg reserved
* completely for recovery work.
*/
if (!readonly && !dp->dp_spa->spa_claiming &&
(ds->ds_dir->dd_crypto_obj == 0 || decrypt)) {
if ((!readonly && !dp->dp_spa->spa_claiming &&
(ds->ds_dir->dd_crypto_obj == 0 || decrypt)) &&
!(dmu_objset_no_upgrades)) {
if (dmu_objset_userobjspace_upgradable(*osp) ||
dmu_objset_projectquota_upgradable(*osp)) {
dmu_objset_id_quota_upgrade(*osp);
Expand Down Expand Up @@ -1492,6 +1498,10 @@ dmu_objset_upgrade(objset_t *os, dmu_objset_upgrade_cb_t cb)
if (os->os_upgrade_id != 0)
return;

if (dmu_objset_no_upgrades != 0) {
return;
}

ASSERT(dsl_pool_config_held(dmu_objset_pool(os)));
dsl_dataset_long_hold(dmu_objset_ds(os), upgrade_tag);

Expand Down Expand Up @@ -2404,6 +2414,8 @@ dmu_objset_id_quota_upgrade_cb(objset_t *os)
if (!dmu_objset_projectquota_enabled(os) &&
dmu_objset_userobjspace_present(os))
return (SET_ERROR(ENOTSUP));
if (dmu_objset_no_upgrades)
return (SET_ERROR(ENOTSUP));

if (dmu_objset_userobjused_enabled(os))
dmu_objset_ds(os)->ds_feature_activation[
Expand Down Expand Up @@ -3075,4 +3087,8 @@ EXPORT_SYMBOL(dmu_objset_projectquota_enabled);
EXPORT_SYMBOL(dmu_objset_projectquota_present);
EXPORT_SYMBOL(dmu_objset_projectquota_upgradable);
EXPORT_SYMBOL(dmu_objset_id_quota_upgrade);

ZFS_MODULE_PARAM(zfs, , dmu_objset_no_upgrades, INT, ZMOD_RW,
"Block upgrade thread triggers");

#endif
2 changes: 1 addition & 1 deletion tests/runfiles/common.run
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ tests = ['zpool_import_001_pos', 'zpool_import_002_pos',
'zpool_import_missing_002_pos', 'zpool_import_missing_003_pos',
'zpool_import_rename_001_pos', 'zpool_import_all_001_pos',
'zpool_import_encrypted', 'zpool_import_encrypted_load',
'zpool_import_errata3', 'zpool_import_errata4',
'zpool_import_errata3',
'import_cachefile_device_added',
'import_cachefile_device_removed',
'import_cachefile_device_replaced',
Expand Down
82 changes: 82 additions & 0 deletions tests/runfiles/enc.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
# This run file contains all of the common functional tests. When
# adding a new test consider also adding it to the sanity.run file
# if the new test runs to completion in only a few seconds.
#
# Approximate run time: 4-5 hours
#

[DEFAULT]
pre = setup
quiet = False
pre_user = root
user = root
timeout = 600
post_user = root
post = cleanup
failsafe_user = root
failsafe = callbacks/zfs_failsafe
outputdir = /var/tmp/test_results
tags = ['functional']


[tests/functional/cli_root/zfs_change-key]
tests = ['zfs_change-key', 'zfs_change-key_child', 'zfs_change-key_format',
'zfs_change-key_inherit', 'zfs_change-key_load', 'zfs_change-key_location',
'zfs_change-key_pbkdf2iters', 'zfs_change-key_clones']
tags = ['functional', 'cli_root', 'zfs_change-key']

[tests/functional/cli_root/zfs_create]
tests = ['zfs_create_encrypted',
'zfs_create_crypt_combos']
tags = ['functional', 'cli_root', 'zfs_create']

[tests/functional/cli_root/zfs_load-key]
tests = ['zfs_load-key', 'zfs_load-key_all', 'zfs_load-key_file',
'zfs_load-key_https', 'zfs_load-key_location', 'zfs_load-key_noop',
'zfs_load-key_recursive']
tags = ['functional', 'cli_root', 'zfs_load-key']

[tests/functional/cli_root/zfs_receive]
tests = ['zfs_receive_from_encrypted', 'zfs_receive_to_encrypted',
'zfs_receive_raw', 'zfs_receive_raw_incremental', 'zfs_receive_-e',
'zfs_receive_raw_-d',
'zfs_receive_-wR-encrypted-mix']
tags = ['functional', 'cli_root', 'zfs_receive']

[tests/functional/cli_root/zfs_send]
tests = ['zfs_send_encrypted', 'zfs_send_raw']
tags = ['functional', 'cli_root', 'zfs_send']

[tests/functional/cli_root/zfs_unload-key]
tests = ['zfs_unload-key', 'zfs_unload-key_all', 'zfs_unload-key_recursive']
tags = ['functional', 'cli_root', 'zfs_unload-key']


[tests/functional/cli_root/zpool_create]
tests = ['zpool_create_encrypted', 'zpool_create_crypt_combos']
tags = ['functional', 'cli_root', 'zpool_create']

[tests/functional/cli_root/zpool_import]
tests = ['zpool_import_encrypted', 'zpool_import_encrypted_load',
'zpool_import_errata3', 'zpool_import_errata4']
tags = ['functional', 'cli_root', 'zpool_import']
timeout = 1200


[tests/functional/rsend]
tests = ['send_encrypted_hierarchy',
'send_encrypted_props', 'send_encrypted_truncated_files',
'send_realloc_encrypted_files','send_mixed_raw', 'send-wR_encrypted_zvol',
'send_raw_spill_block', 'send_raw_ashift']
tags = ['functional', 'rsend']

49 changes: 49 additions & 0 deletions tests/runfiles/enc2.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
# This run file contains all of the common functional tests. When
# adding a new test consider also adding it to the sanity.run file
# if the new test runs to completion in only a few seconds.
#
# Approximate run time: 4-5 hours
#

[DEFAULT]
pre = setup
quiet = False
pre_user = root
user = root
timeout = 600
post_user = root
post = cleanup
failsafe_user = root
failsafe = callbacks/zfs_failsafe
outputdir = /var/tmp/test_results
tags = ['functional']


[tests/functional/cli_root/zpool_create]
tests = ['zpool_create_encrypted', 'zpool_create_crypt_combos']
tags = ['functional', 'cli_root', 'zpool_create']

[tests/functional/cli_root/zpool_import]
tests = ['zpool_import_encrypted', 'zpool_import_encrypted_load',
'zpool_import_errata3', 'zpool_import_errata4']
tags = ['functional', 'cli_root', 'zpool_import']
timeout = 1200


[tests/functional/rsend]
tests = ['send_encrypted_hierarchy',
'send_encrypted_props', 'send_encrypted_truncated_files',
'send_realloc_encrypted_files','send_mixed_raw', 'send-wR_encrypted_zvol',
'send_raw_spill_block', 'send_raw_ashift']
tags = ['functional', 'rsend']

0 comments on commit 6bd8a97

Please sign in to comment.