openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.32k stars 1.72k forks source link

ZFS destroys in channel programs sometimes report they succeed when they actually fail #13844

Open seonwoolee opened 1 year ago

seonwoolee commented 1 year ago

System information

Type Version/Name
Distribution Name Arch LInux
Distribution Version N/A
Kernel Version 5.18.19-hardened
Architecture x86-64
OpenZFS Version 2.1.5-1

Describe the problem you're observing

ZFS channel programs report deleting a non existent snapshot succeeds

Describe how to reproduce the problem

ZFS channel program test_destroy.lua:

if zfs.check.destroy("test@1")~=0 then
    error("deleting test@1 would fail")
end

if zfs.sync.destroy("test@1")~=0 then
    error("deleting test@1 failed")
end

Testing the channel program

truncate -s 1G /tmp/test-pool
zpool create test /tmp/test-pool
zfs program test test_destroy.lua

Output:

Channel program fully executed and did not produce output.

If I create the snapshot with zfs snapshot test@1 and then run test_destroy.lua, it does in fact destroy the snapshot. So the command is being run properly, but the error reporting by zfs.check.destroy and zfs.sync.destroy is broken

stale[bot] commented 9 months ago

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

seonwoolee commented 8 months ago

Bump? This is still an issue for me