diff --git a/common/device-scan.c b/common/device-scan.c index a34d8665..7d7d67fb 100644 --- a/common/device-scan.c +++ b/common/device-scan.c @@ -148,7 +148,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, if (!device) return -ENOMEM; - buf = calloc(1, sectorsize); + buf = calloc(1, BTRFS_SUPER_INFO_SIZE); if (!buf) { ret = -ENOMEM; goto out;