]> rtime.felk.cvut.cz Git - linux-imx.git/commit
Btrfs: do not overcommit if we don't have enough space for global rsv
authorJosef Bacik <jbacik@fusionio.com>
Wed, 30 Jan 2013 22:02:51 +0000 (17:02 -0500)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 20 Feb 2013 17:59:13 +0000 (12:59 -0500)
commit96f1bb57771f71bf1d55d5031a1cf47908494330
treea5333d0eb2a778a043182dfedd1f8faa3fc69d87
parent0f5d42b287f32417e54485d79f2318cf2970b37d
Btrfs: do not overcommit if we don't have enough space for global rsv

Because of how little we allocate chunks now we can get really tight on
metadata space before we will allocate a new chunk.  This resulted in being
unable to add device extents when allocating a new metadata chunk as we did
not have enough space.  This is because we were allowed to overcommit too
much metadata without actually making sure we had enough space to make
allocations.  The idea behind overcommit is that we are allowed to say "sure
you can have that reservation" when most of the free space is occupied by
reservations, not actual allocations.  But in this case where a majority of
the total space is in use by actual allocations we can screw ourselves by
not being able to make real allocations when it matters.  So make sure we
have enough real space for our global reserve, and if not then don't allow
overcommitting.  Thanks,

Reported-and-tested-by: Jim Schutt <jaschut@sandia.gov>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/extent-tree.c