summaryrefslogtreecommitdiffstats
path: root/fs/internal.h
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-03-25 16:03:35 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-03-28 09:51:26 -0400
commitf4881bc7a83eff263789dd524b7c269d138d4af5 (patch)
treed305caf38f58f140b952e14fa707964c905356b0 /fs/internal.h
parentadaa4b8e4d47eeb114513c2f7a172929154b94bd (diff)
downloadop-kernel-dev-f4881bc7a83eff263789dd524b7c269d138d4af5.zip
op-kernel-dev-f4881bc7a83eff263789dd524b7c269d138d4af5.tar.gz
Btrfs: fix space leak when we fail to reserve metadata space
Dave reported a warning when running xfstest 275. We have been leaking delalloc metadata space when our reservations fail. This is because we were improperly calculating how much space to free for our checksum reservations. The problem is we would sometimes free up space that had already been freed in another thread and we would end up with negative usage for the delalloc space. This patch fixes the problem by calculating how much space the other threads would have already freed, and then calculate how much space we need to free had we not done the reservation at all, and then freeing any excess space. This makes xfstests 275 no longer have leaked space. Thanks Cc: stable@vger.kernel.org Reported-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/internal.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud