The blockmap layer1/2 CRCs were being checked without the blockmap lock
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 26 Dec 2008 19:45:42 +0000 (11:45 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 26 Dec 2008 19:45:42 +0000 (11:45 -0800)
commitdb9f9d7f3e5ba4db32825e60e606a0e4a0a33083
tree33bcf47b7bae670927c3cfa61a4b2e439d29042f
parent822e0d97e348e2bf20a4762563651e0f6fd479f0
The blockmap layer1/2 CRCs were being checked without the blockmap lock
being held.  It was possible for the check to occur while another thread
was blocked with the layer half-modified, resulting in an assertion but
NO on-media corruption.

Fix the issue in an optimal manner by rechecking the CRC with the blockmap
locked when the first check fails.  Only assert if the second check fails.

Reported-by: Matthias Schmidt <matthias@crater.dragonflybsd.org>
sys/vfs/hammer/hammer_blockmap.c