]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: always wait on ordered extents at fsync time
authorJosef Bacik <jbacik@fb.com>
Wed, 23 May 2018 15:58:33 +0000 (11:58 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:30 +0000 (13:12 +0200)
commit149cbed22c892c6533fca08e697fc0938a609d4c
tree5be5957abc526d16b99d8b43c5913aa9b844cdb1
parent84004469eb44f1b9733f6d4886f717f4e7d3809a
btrfs: always wait on ordered extents at fsync time

There's a priority inversion that exists currently with btrfs fsync.  In
some cases we will collect outstanding ordered extents onto a list and
only wait on them at the very last second.  However this "very last
second" falls inside of a transaction handle, so if we are in a lower
priority cgroup we can end up holding the transaction open for longer
than needed, so if a high priority cgroup is also trying to fsync()
it'll see latency.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c