Commit 387824af authored by David Sterba's avatar David Sterba

btrfs: use the right number of levels for lockdep keysets

BTRFS_MAX_LEVEL is 8 and the keyset table is supposed to have a key for
each level, but we'll never have more than 8 levels.  The values passed
to btrfs_set_buffer_lockdep_class are always derived from a valid extent
buffer.  Set the array sizes to the right value.
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent ecfdc08b
...@@ -153,8 +153,8 @@ struct async_submit_bio { ...@@ -153,8 +153,8 @@ struct async_submit_bio {
static struct btrfs_lockdep_keyset { static struct btrfs_lockdep_keyset {
u64 id; /* root objectid */ u64 id; /* root objectid */
const char *name_stem; /* lock name stem */ const char *name_stem; /* lock name stem */
char names[BTRFS_MAX_LEVEL + 1][20]; char names[BTRFS_MAX_LEVEL][20];
struct lock_class_key keys[BTRFS_MAX_LEVEL + 1]; struct lock_class_key keys[BTRFS_MAX_LEVEL];
} btrfs_lockdep_keysets[] = { } btrfs_lockdep_keysets[] = {
{ .id = BTRFS_ROOT_TREE_OBJECTID, .name_stem = "root" }, { .id = BTRFS_ROOT_TREE_OBJECTID, .name_stem = "root" },
{ .id = BTRFS_EXTENT_TREE_OBJECTID, .name_stem = "extent" }, { .id = BTRFS_EXTENT_TREE_OBJECTID, .name_stem = "extent" },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment