mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-08 13:01:23 +00:00
Zero btree item padding as items are created
Item creation, which fills out a new item at the end of the array of item structs at the start of the block, didn't explicitly zero the item struct padding to 0. It would only have been zero if the memory was already zero, which is likely for new blocks, but isn't necessarily true if the memory had previously been used by deleted values. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -521,6 +521,7 @@ static void create_item(struct scoutfs_btree_block *bt,
|
||||
|
||||
item->val_off = insert_value(bt, ptr_off(bt, item), val, val_len);
|
||||
item->val_len = cpu_to_le16(val_len);
|
||||
memset(item->__pad, 0, sizeof(item->__pad));
|
||||
|
||||
le16_add_cpu(&bt->total_item_bytes, item_bytes(item));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user