diff options
author | Chris Mason <clm@fb.com> | 2015-01-21 17:49:35 -0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-01-21 17:49:35 -0800 |
commit | 57bbddd7fbf468336940d18a4c68a8678163acb0 (patch) | |
tree | 5d9c5ecf6ba145cdaf369e0c6ddfc4ea88ce8dd9 /fs/btrfs/volumes.c | |
parent | d3541834884f042aaaab1d6c0610cdc3488028e4 (diff) | |
parent | ce3e69847e3ec79a38421bfd3d6f554d5e481231 (diff) |
Merge branch 'cleanup/blocksize-diet-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 50c5a8762aed..0d9bfebdaa4c 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -6247,8 +6247,13 @@ int btrfs_read_sys_array(struct btrfs_root *root) u32 cur; struct btrfs_key key; - sb = btrfs_find_create_tree_block(root, BTRFS_SUPER_INFO_OFFSET, - BTRFS_SUPER_INFO_SIZE); + ASSERT(BTRFS_SUPER_INFO_SIZE <= root->nodesize); + /* + * This will create extent buffer of nodesize, superblock size is + * fixed to BTRFS_SUPER_INFO_SIZE. If nodesize > sb size, this will + * overallocate but we can keep it as-is, only the first page is used. + */ + sb = btrfs_find_create_tree_block(root, BTRFS_SUPER_INFO_OFFSET); if (!sb) return -ENOMEM; btrfs_set_buffer_uptodate(sb); |