Skip to content

Commit ee3bde9

Browse files
authored
ZTS: checkpoint_discard_busy should use save_tunable/restore_tunable
Instead of using hardwired value for SPA_DISCARD_MEMORY_LIMIT, use save_tunable and restore_tunable to restore the pre-test state. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Toomas Soome <[email protected]> Closes #16919
1 parent c02e1cf commit ee3bde9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ log_unsupported "Skipping, issue https://github.com/openzfs/zfs/issues/12053"
4242

4343
function test_cleanup
4444
{
45-
# reset memory limit to 16M
46-
set_tunable64 SPA_DISCARD_MEMORY_LIMIT 16777216
45+
# reset to original value
46+
log_must restore_tunable SPA_DISCARD_MEMORY_LIMIT
4747
cleanup_nested_pools
4848
}
4949

@@ -69,6 +69,7 @@ log_onexit test_cleanup
6969
# map, we should have even more time to
7070
# verify this.
7171
#
72+
log_must save_tunable SPA_DISCARD_MEMORY_LIMIT
7273
set_tunable64 SPA_DISCARD_MEMORY_LIMIT 128
7374

7475
log_must zpool checkpoint $NESTEDPOOL
@@ -101,8 +102,8 @@ log_mustnot zpool checkpoint -d $NESTEDPOOL
101102
log_mustnot zpool remove $NESTEDPOOL $FILEDISK1
102103
log_mustnot zpool reguid $NESTEDPOOL
103104

104-
# reset memory limit to 16M
105-
set_tunable64 SPA_DISCARD_MEMORY_LIMIT 16777216
105+
# reset to original value
106+
log_must restore_tunable SPA_DISCARD_MEMORY_LIMIT
106107

107108
nested_wait_discard_finish
108109

0 commit comments

Comments
 (0)