Commit 2cc3c559 authored by Yan Zheng's avatar Yan Zheng Committed by Chris Mason

Btrfs: set device->total_disk_bytes when adding new device

It was not being properly initialized, and so the size saved to
disk was not correct.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 9f55684c
...@@ -1440,6 +1440,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) ...@@ -1440,6 +1440,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
device->io_align = root->sectorsize; device->io_align = root->sectorsize;
device->sector_size = root->sectorsize; device->sector_size = root->sectorsize;
device->total_bytes = i_size_read(bdev->bd_inode); device->total_bytes = i_size_read(bdev->bd_inode);
device->disk_total_bytes = device->total_bytes;
device->dev_root = root->fs_info->dev_root; device->dev_root = root->fs_info->dev_root;
device->bdev = bdev; device->bdev = bdev;
device->in_fs_metadata = 1; device->in_fs_metadata = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment