Skip to content

ZTS: add regression test for #17180 - #18109

Merged
behlendorf merged 1 commit into
openzfs:masterfrom
delan:regression-test-for-17180
Jan 6, 2026
Merged

behlendorf merged 1 commit into
openzfs:masterfrom
delan:regression-test-for-17180

Conversation

@delan

@delan delan commented Jan 4, 2026 •

Copy link
Copy Markdown
Contributor

Motivation and Context

#17180 fixed an interesting bug that i believe i hit in one of my pools, but as far as i can tell, there was no test for it.

Description

this patch adds a regression test for #17180, minimised from my attempts to reproduce the bug in a way that resembled the history of my pool.

How Has This Been Tested?

tested using quiz, on linux 6.12.44 and zfs 2.3.1, with and without #17180 applied. without the patch, it kernel panics every time. with the patch, it passes every time. similarly on the latest zfs, it passes every time, but if the reverse patch is applied, it kernel panics every time.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@delan

delan commented Jan 4, 2026

Copy link
Copy Markdown
Contributor Author
original repro, as quiz user program
#!/usr/bin/env bash
# QUIZ_KERNEL_VERSION=6.12.44
# QUIZ_MEM=24G
# QUIZ_BLOCKDEV_COUNT=2
# QUIZ_BLOCKDEV_SIZE=5G
set -euvx
free -h
zpool create -o ashift=16 foo /dev/quizb0 /dev/quizb1
zfs create foo/home
dd if=/dev/urandom of=/foo/home/DSC0001.JPG bs=1M count=32
dd if=/dev/urandom of=/foo/home/DSC0002.JPG bs=1M count=32
snap0=$(date -u +\%TZ); zfs snapshot -r foo@$snap0; sleep 1
zfs create foo/photos
cp -av /foo/home/* /foo/photos/
snap1=$(date -u +\%TZ); zfs snapshot -r foo@$snap1; sleep 1
zpool remove -w foo /dev/quizb0
zfs send -Rv foo@$snap1 > /dev/null
dd if=/dev/urandom of=/foo/photos/DSC0002.JPG bs=1M count=33
snap2=$(date -u +\%TZ); zfs snapshot -r foo@$snap2; sleep 1
zfs send -Rv foo@$snap2 > /dev/null
rm -v /foo/home/*
snap3=$(date -u +\%TZ); zfs snapshot -r foo@$snap3; sleep 1
zfs destroy -vn foo/home@$snap0\%$snap2
zfs destroy -v foo/home@$snap0\%$snap2
zfs send -Rv foo@$snap2 > /dev/null || :
zfs send -Rv foo/photos@$snap2 > /dev/null
for i in {3..9}; do dd if=/dev/urandom of=/foo/photos/DSC000$i.JPG bs=1M count=129; done
zpool add foo /dev/quizb0
for i in {0..9}; do dd if=/dev/urandom of=/foo/photos/DSC001$i.JPG bs=1M count=129; done
snap4=$(date -u +\%TZ); zfs snapshot -r foo@$snap4; sleep 1
for i in {1..9}; do dd if=/dev/urandom of=/foo/photos/DSC000$i.JPG.xmp bs=1k count=129; done
for i in {0..9}; do dd if=/dev/urandom of=/foo/photos/DSC001$i.JPG.xmp bs=1k count=129; done
snap5=$(date -u +\%TZ); zfs snapshot -r foo@$snap5; sleep 1
zfs create foo/photos2
cp -av /foo/photos/* /foo/photos2/
snap6=$(date -u +\%TZ); zfs snapshot -r foo@$snap6; sleep 1
zpool remove -w foo /dev/quizb1
zfs create foo/photos/2024
zfs create foo/photos/2025
strace cp -a /foo/photos/DSC000* /foo/photos/2024/
cp -a /foo/photos/DSC001* /foo/photos/2025/
for i in {0..9}; do dd if=/dev/urandom of=/foo/photos/2025/DSC001$i.JPG.xmp bs=1k count=65 conv=notrunc; done
# this one needs a couple of tries, because it initially fails with “out of space”
snap7=$(date -u +\%TZ); while ! zfs snapshot -r foo@$snap7; do sleep 1; done; sleep 1
rm /foo/photos/DSC*
snap8=$(date -u +\%TZ); zfs snapshot -r foo@$snap8; sleep 1
zfs destroy foo/home@\%
zfs destroy -vn foo/photos@$snap1\%$snap7
zfs destroy -v foo/photos@$snap1\%$snap7
zfs send -Rv foo/photos2@$snap8 > /dev/null
zfs send -Rv foo/photos@$snap8 > /dev/null
zfs send -Rv foo@$snap8 > /dev/null || :
zfs snapshot foo/home@$snap8
zfs send -Rv foo@$snap8 > /dev/null
zfs send -Rv foo@$snap8 > /dev/null
zpool add foo /dev/quizb1
zfs destroy -vn foo/photos2 || :
zfs destroy -rvn foo/photos2
zfs destroy -rv foo/photos2
zpool remove -w foo /dev/quizb0
zfs send -Rv foo@$snap8 > /dev/null
zfs create foo/photos2
cp -a /foo/photos/202?/* /foo/photos2
# this one needs a couple of tries, because it initially fails with “out of space”
while ! zfs create foo/photos3; do sleep 1; done
cp -a /foo/photos/202?/* /foo/photos3
zpool add foo /dev/quizb0
zfs create foo/photos4
cp -a /foo/photos/202?/* /foo/photos4
zfs create foo/photos5
cp -a /foo/photos/202?/* /foo/photos5
zfs create foo/photos6
cp -a /foo/photos/202?/* /foo/photos6
snap9=$(date -u +\%TZ); zfs snapshot -r foo@$snap9; sleep 1
for i in {0..9}; do dd if=/dev/urandom of=/foo/photos3/DSC001$i.JPG bs=1M count=33 conv=notrunc; done
for i in {0..9}; do dd if=/dev/urandom of=/foo/photos5/DSC001$i.JPG bs=1M count=33 conv=notrunc; done
snap10=$(date -u +\%TZ); zfs snapshot -r foo@$snap10; sleep 1
zpool remove -w foo /dev/quizb1
for i in {0..9}; do dd if=/dev/urandom of=/foo/photos2/DSC001$i.JPG bs=1M count=33 conv=notrunc; done
for i in {0..9}; do dd if=/dev/urandom of=/foo/photos4/DSC001$i.JPG bs=1M count=33 conv=notrunc; done
snap11=$(date -u +\%TZ); zfs snapshot -r foo@$snap11 || :; sleep 1
zfs destroy -r foo/photos6
zfs destroy -r foo/photos5
zfs destroy -r foo/photos4
minimised repro, as quiz user program
#!/usr/bin/env bash
# QUIZ_KERNEL_VERSION=6.12.44
# QUIZ_BLOCKDEV_COUNT=2
# QUIZ_BLOCKDEV_SIZE=200M
set -euvx
zpool create foo /dev/quizb0 /dev/quizb1
dd if=/dev/urandom of=/foo/file bs=16M count=2
zpool remove -w foo /dev/quizb1
zfs create foo/d
cp /foo/file /foo/d
dd if=/dev/urandom of=/foo/file bs=16M count=2
zfs destroy -r foo/d

@delan
delan force-pushed the regression-test-for-17180 branch from 32e6106 to 8ba2869 Compare January 4, 2026 12:14

@adamdmoss adamdmoss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Glad to have a regression test for this.

@behlendorf behlendorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a test case for this. Just a couple of comments.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jan 5, 2026
in openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Signed-off-by: delan azabani 
@delan
delan force-pushed the regression-test-for-17180 branch from e80efd8 to b08dbb7 Compare January 6, 2026 02:56
@delan
delan requested review from amotin and behlendorf January 6, 2026 02:56

@amotin amotin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you say without the patch this test causes a panic, then I have no objections.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jan 6, 2026
@behlendorf
behlendorf merged commit 6eef5cd into openzfs:master Jan 6, 2026
39 of 41 checks passed
@delan
delan deleted the regression-test-for-17180 branch January 6, 2026 23:32
amotin pushed a commit to amotin/zfs that referenced this pull request Jan 29, 2026
In openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes openzfs#18109
mcmilk pushed a commit to mcmilk/zfs that referenced this pull request Jan 31, 2026
In openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes openzfs#18109
amotin pushed a commit to amotin/zfs that referenced this pull request Feb 3, 2026
In openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes openzfs#18109
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Feb 5, 2026
In openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes openzfs#18109
tonyhutter pushed a commit that referenced this pull request Feb 5, 2026
In #17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for #17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes #18109
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Feb 23, 2026
In openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes openzfs#18109
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Feb 23, 2026
In openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes openzfs#18109
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Apr 23, 2026
In openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes openzfs#18109
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request May 6, 2026
In openzfs#17180, we fixed an interesting bug that i believe i hit in one of my
pools, but as far as i can tell, there was no test for it.

this patch adds a regression test for openzfs#17180, minimised from my attempts
to reproduce the bug in a way that resembled the history of my pool.

Reviewed-by: Alexander Motin 
Reviewed-by: Brian Behlendorf 
Reviewed-by: Adam Moss 
Signed-off-by: delan azabani 
Closes openzfs#18109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants