]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix outstanding_extents accounting in DIO
authorJosef Bacik <jbacik@fb.com>
Tue, 17 Mar 2015 14:52:28 +0000 (10:52 -0400)
committerJosef Bacik <jbacik@fb.com>
Tue, 17 Mar 2015 20:36:35 +0000 (16:36 -0400)
commit0ff95660df37b7918f1988a69e527f13c2b416fe
tree0b2a6f3ccbcf72d81aff6119bbba83d02bc3d665
parent8862f0ca637d3d121e730a2bf1cee512d8a7c966
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>
fs/btrfs/inode.c