mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
Btrfs: fix delalloc reservation amount tracepoint
We can sometimes drop the reservation we had for our inode, so we need to remove that amount from to_reserve so that our tracepoint reports a valid amount of space. Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c51e7bb184
commit
f485c9ee32
1 changed files with 3 additions and 1 deletions
|
@ -6000,8 +6000,10 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes)
|
||||||
|
|
||||||
spin_lock(&BTRFS_I(inode)->lock);
|
spin_lock(&BTRFS_I(inode)->lock);
|
||||||
if (test_and_set_bit(BTRFS_INODE_DELALLOC_META_RESERVED,
|
if (test_and_set_bit(BTRFS_INODE_DELALLOC_META_RESERVED,
|
||||||
&BTRFS_I(inode)->runtime_flags))
|
&BTRFS_I(inode)->runtime_flags)) {
|
||||||
|
to_reserve -= btrfs_calc_trans_metadata_size(root, 1);
|
||||||
release_extra = true;
|
release_extra = true;
|
||||||
|
}
|
||||||
BTRFS_I(inode)->reserved_extents += nr_extents;
|
BTRFS_I(inode)->reserved_extents += nr_extents;
|
||||||
spin_unlock(&BTRFS_I(inode)->lock);
|
spin_unlock(&BTRFS_I(inode)->lock);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue