diff options
author | Zach Brown <zab@redhat.com> | 2013-01-22 15:03:46 -0800 |
---|---|---|
committer | Zach Brown <zab@redhat.com> | 2013-02-05 16:09:39 -0800 |
commit | 7d365c5a87cdb542c204086b4d1d7aa00cd7b09f (patch) | |
tree | 7a205be4ba3348d6d576f35482fbd9912eeebe65 /volumes.c | |
parent | fd732dd81a698c90387a3611134e5fffec07411b (diff) |
btrfs-progs: don't write memory after sb to disk
struct btrfs_super is about 3.5k but a few writing paths were writing it
out as the full 4k BTRFS_SUPER_INFO_SIZE, leaking a few hundred bytes
after the super_block onto disk. In practice this meant the memory
after super_copy in struct btrfs_fs_info and whatever came after it in
the heap.
Signed-off-by: Zach Brown <zab@redhat.com>
Diffstat (limited to 'volumes.c')
-rw-r--r-- | volumes.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1502,7 +1502,7 @@ int btrfs_read_sys_array(struct btrfs_root *root) if (!sb) return -ENOMEM; btrfs_set_buffer_uptodate(sb); - write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE); + write_extent_buffer(sb, super_copy, 0, sizeof(*super_copy)); array_size = btrfs_super_sys_array_size(super_copy); /* |