diff options
author | Josef Bacik <[email protected]> | 2020-10-23 09:58:04 -0400 |
---|---|---|
committer | David Sterba <[email protected]> | 2020-12-08 15:54:02 +0100 |
commit | 9076dbd5ee837c3882fc42891c14cecd0354a849 (patch) | |
tree | 17fcaa377b1a8fc6cd7426ee6f0730624deb350e /lib/test_overflow.c | |
parent | dc516164869300efd0bdbf6f894defc306588b75 (diff) |
btrfs: do not shorten unpin len for caching block groups
While fixing up our ->last_byte_to_unpin locking I noticed that we will
shorten len based on ->last_byte_to_unpin if we're caching when we're
adding back the free space. This is correct for the free space, as we
cannot unpin more than ->last_byte_to_unpin, however we use len to
adjust the ->bytes_pinned counters and such, which need to track the
actual pinned usage. This could result in
WARN_ON(space_info->bytes_pinned) triggering at unmount time.
Fix this by using a local variable for the amount to add to free space
cache, and leave len untouched in this case.
CC: [email protected] # 5.4+
Reviewed-by: Filipe Manana <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions