summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2009-06-04 15:23:50 +0200
committerChris Mason <chris.mason@oracle.com>2009-06-04 15:23:57 +0200
commit2cc3c559fb2fe8cecca82a517bc56e88b0c1effd (patch)
treed060c3b3d9943a8f8aaddc5f6748b9ca59d90ee5 /fs/btrfs
parentBtrfs: Spelling fix in btrfs_lookup_first_block_group comments (diff)
downloadlinux-2cc3c559fb2fe8cecca82a517bc56e88b0c1effd.tar.xz
linux-2cc3c559fb2fe8cecca82a517bc56e88b0c1effd.zip
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: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/volumes.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 5f01dad4b696..a6d35b0054ca 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1440,6 +1440,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
device->io_align = root->sectorsize;
device->sector_size = root->sectorsize;
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->bdev = bdev;
device->in_fs_metadata = 1;