summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2017-05-10 13:25:27 -0400
committerBrian Behlendorf <[email protected]>2017-05-10 10:25:27 -0700
commitf486f58440cc6bf7e699aa2870da142a83cac04e (patch)
treeb73448c2c1d6c51c84bcc8b2e0cd3ea6605824cd /module
parent2946a1a15aab874107b4425513c1bf805e730803 (diff)
Add missing arc_free_cksum() to arc_release()
The arc layer tracks checksums of its data in the arc header so that it can ensure that buffers haven't changed when they're not supposed to. This checksum is only maintained while there is an uncompressed buffer still attached to the header. Unfortunately there is a missing call to arc_free_cksum() in arc_release() that can trigger ASSERTs. This has not been a common issue because the checksums are only maintained for debug builds and triggering the bug requires writing a block (and therefore calling arc_release()) while a compressed buffer is still being used on a debug build. This simply corrects the issue. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #6105
Diffstat (limited to 'module')
-rw-r--r--module/zfs/arc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index acf98dd2d..492a33a60 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -5691,6 +5691,10 @@ arc_release(arc_buf_t *buf, void *tag)
arc_cksum_verify(buf);
arc_buf_unwatch(buf);
+ /* if this is the last uncompressed buf free the checksum */
+ if (!arc_hdr_has_uncompressed_buf(hdr))
+ arc_cksum_free(hdr);
+
mutex_exit(hash_lock);
/*