Fix ring block tail zeroing

The ring block tail zeroing memset treated the value as the offset to
zero from, not the number of bytes at the tail to zero.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2016-12-08 09:39:46 -08:00
parent fd7b09b4e4
commit b8ede1f6ee

View File

@@ -57,7 +57,7 @@ struct ring_info {
*/
static void finish_block(struct scoutfs_ring_block *ring, unsigned int tail)
{
memset((char *)ring + tail, 0, SCOUTFS_BLOCK_SIZE - tail);
memset((char *)ring + SCOUTFS_BLOCK_SIZE - tail, 0, tail);
scoutfs_crc_block(&ring->hdr);
}