On Wed, Mar 11, 2020 at 01:59:14PM -0400, Josef Bacik wrote: > >>> u64 to_reclaim = 0; > >>> > >>> - list_for_each_entry(ticket, &space_info->tickets, list) > >>> - to_reclaim += ticket->bytes; > >>> - list_for_each_entry(ticket, &space_info->priority_tickets, list) > >>> - to_reclaim += ticket->bytes; > >>> + lockdep_assert_held(&space_info->lock); > >>> + > >>> + if (space_info->reclaim_size) > >>> + return space_info->reclaim_size; > >> > >> This undoes the fix that I put up making sure we include any space we > >> can no longer overcommit. Thanks, > > > > Which fix is that? > > https://github.com/kdave/btrfs-devel/commit/593212a6137ff3c5674609b4233f8ecec459dc45 Nik sent me a fixup, now folded to the patch. diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index 9c36397b733c..0884dac883b5 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -792,13 +792,10 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info, u64 used; u64 avail; u64 expected; - u64 to_reclaim = 0; + u64 to_reclaim = space_info->reclaim_size; lockdep_assert_held(&space_info->lock); - if (space_info->reclaim_size) - return space_info->reclaim_size; - avail = calc_available_free_space(fs_info, space_info, BTRFS_RESERVE_FLUSH_
