diff options
| author | Liu Bo <[email protected]> | 2014-07-02 08:58:01 +0000 |
|---|---|---|
| committer | Chris Mason <[email protected]> | 2014-07-03 14:04:15 +0000 |
| commit | d288db5dc0110c8e0732d099aaf7a05e2ea0e0c8 (patch) | |
| tree | 8f25c749e2d6199d47888278c3a22b5dc066249a /fs/btrfs/print-tree.c | |
| parent | btrfs: use E2BIG instead of EIO if compression does not help (diff) | |
| download | kernel-d288db5dc0110c8e0732d099aaf7a05e2ea0e0c8.tar.gz kernel-d288db5dc0110c8e0732d099aaf7a05e2ea0e0c8.zip | |
Btrfs: fix race of using total_bytes_pinned
This percpu counter @total_bytes_pinned is introduced to skip unnecessary
operations of 'commit transaction', it accounts for those space we may free
but are stuck in delayed refs.
And we zero out @space_info->total_bytes_pinned every transaction period so
we have a better idea of how much space we'll actually free up by committing
this transaction. However, we do the 'zero out' part a little earlier, before
we actually unpin space, so we end up returning ENOSPC when we actually have
free space that's just unpinned from committing transaction.
xfstests/generic/074 complained then.
This fixes it by actually accounting the percpu pinned number when 'unpin',
and since it's protected by space_info->lock, the race is gone now.
Signed-off-by: Liu Bo <[email protected]>
Reviewed-by: Miao Xie <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
Diffstat (limited to 'fs/btrfs/print-tree.c')
0 files changed, 0 insertions, 0 deletions
