summaryrefslogtreecommitdiff
path: root/volumes.c
diff options
context:
space:
mode:
authorZach Brown <zab@redhat.com>2013-01-22 15:03:46 -0800
committerZach Brown <zab@redhat.com>2013-02-05 16:09:39 -0800
commit7d365c5a87cdb542c204086b4d1d7aa00cd7b09f (patch)
tree7a205be4ba3348d6d576f35482fbd9912eeebe65 /volumes.c
parentfd732dd81a698c90387a3611134e5fffec07411b (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/volumes.c b/volumes.c
index 9c527197..65986e15 100644
--- a/volumes.c
+++ b/volumes.c
@@ -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);
/*