]> git.hungrycats.org Git - linux/commit
Btrfs: fix outstanding_extents accounting in DIO
authorJosef Bacik <jbacik@fb.com>
Tue, 17 Mar 2015 14:52:28 +0000 (10:52 -0400)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Fri, 27 Mar 2015 03:34:30 +0000 (23:34 -0400)
commitd77ea57096f56b2d47341eed88f37fde4e0e97c6
tree3f253d3f2255bb7268dfa182744186a620e06140
parentbc3579eb34d95f819635d1b2fb715fc5a3c3c3cb
Btrfs: fix outstanding_extents accounting in DIO

We are keeping track of how many extents we need to reserve properly based on
the amount we want to write, but we were still incrementing outstanding_extents
if we wrote less than what we requested.  This isn't quite right since we will
be limited to our max extent size.  So instead lets do something horrible!  Keep
track of how many outstanding_extents we reserved, and decrement each time we
allocate an extent.  If we use our entire reserve make sure to jack up
outstanding_extents on the inode so the accounting works out properly.  Thanks,

Reported-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
(cherry picked from commit e1cbbfa5f5aaf40a1fe70856fac4dfcc33e0e651)
fs/btrfs/inode.c