It would make sense to me that "lfs hsm_release" would cause all of the DLM locks to be revoked from the client, so any stat from the client would return st_blocks == 1. This should be visible in the debug logs, if this test is run with at least +dlmtrace enabled.
I think in the short term it makes sense to fix sanity-hsm.sh test_21 to enable full debug for this test (using debugsave() and debugrestore()), and print the actual block number that is returned. Maybe it is as simple as ZFS returning 2 with an external xattr or something, which might even happen with ldiskfs? Probably it makes sense to also allow some small margin, like 5 blocks or so. This test is also bad because there are two places that print "wrong block number", and it isn't even clear which one is failing.
I think it makes sense to submit a patch to change this immediately to the following:
local fid=$(make_small $f)
local orig_size=$(stat -c "%s" $f)
local orig_blocks=$(stat -c "%b" $f)
check_hsm_flags $f "0x00000000"
$LFS hsm_archive $f || error "could not archive file"
wait_request_state $fid ARCHIVE SUCCEED
local blocks=$(stat -c "%b" $f)
[ $blocks -eq $orig_blocks ] || error "$f: wrong blocks after archive: $blocks != $orig_blocks"
local size=$(stat -c "%s" $f)
[ $size -eq $orig_size ] || error "$f: wrong size after archive: $size != $orig_size"
# Release and check states
$LFS hsm_release $f || error "$f: could not release file"
check_hsm_flags $f "0x0000000d"
blocks=$(stat -c "%b" $f)
[ $blocks -gt 5 ] || error "$f: too many blocks after release: $blocks > 5"
size=$(stat -c "%s" $f)
[ $size -ne $orig_size ] || error "$f: wrong size after release: $size != $orig_size"
Maybe this will allow ZFS to pass, but even if it doesn't then we will have more information to debug the problem.
In case 8467 doesn't fix 21 for ZFS, here is a patch to EXCEPT it: http://review.whamcloud.com/8503