diff options
author | David Sterba <dsterba@suse.com> | 2016-11-04 15:11:54 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-09 13:47:34 +0100 |
commit | 92576929fbbeb3c41abba9a4a217a6c69d546c7e (patch) | |
tree | 4226f93d7a0326b164a1a906415c6d4ca66e2965 | |
parent | 9e0dd182b4fb8ca87c47c256c25a43b6505cc45b (diff) |
btrfs-progs: fix unaligned u64 access in btrfs_alloc_data_chunk
The key.offset member is not well-aligned as the key is packed, use a
temporary variable to pass the argument. Reported by ASAN in misc test
002.
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | volumes.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1080,9 +1080,12 @@ int btrfs_alloc_data_chunk(struct btrfs_trans_handle *trans, key.offset = *start; dev_offset = *start; } else { + u64 tmp; + ret = find_next_chunk(chunk_root, BTRFS_FIRST_CHUNK_TREE_OBJECTID, - &key.offset); + &tmp); + key.offset = tmp; if (ret) return ret; } |