]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix wrong device bytes_used in the super block
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 3 Sep 2014 13:35:34 +0000 (21:35 +0800)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:38:34 +0000 (13:38 -0700)
commit575514257db1f0a9b2fb952fd13346d8ec98f0bb
tree3b458f3f28ae3d69f508b4bd9194a264f74f6f34
parentbe85f558b3f5b399fb4bac0bc1146e721a190f2c
Btrfs: fix wrong device bytes_used in the super block

device->bytes_used will be changed when allocating a new chunk, and
disk_total_size will be changed if resizing is successful.
Meanwhile, the on-disk super blocks of the previous transaction
might not be updated. Considering the consistency of the metadata
in the previous transaction, We should use the size in the previous
transaction to check if the super block is beyond the boundary
of the device.

Though it is not big problem because we don't use it now, but anyway
it is better that we make it be consistent with the common metadata,
maybe we will use it in the future.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c
fs/btrfs/transaction.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h