]> git.hungrycats.org Git - linux/commit
Btrfs: make sure we wait on logged extents when fsycning two subvols
authorJosef Bacik <jbacik@fb.com>
Thu, 6 Nov 2014 15:19:54 +0000 (10:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 18:30:29 +0000 (10:30 -0800)
commitd77fe802ae851a65356b1691ff97cd568b9e7d5c
tree7bfcc7027b06a7275ad213fc38b35118b4cddcd2
parentd7fad547c36925f69c67fd19a97731d3d38706a2
Btrfs: make sure we wait on logged extents when fsycning two subvols

commit 9dba8cf128ef98257ca719722280c9634e7e9dc7 upstream.

If we have two fsync()'s race on different subvols one will do all of its work
to get into the log_tree, wait on it's outstanding IO, and then allow the
log_tree to finish it's commit.  The problem is we were just free'ing that
subvols logged extents instead of waiting on them, so whoever lost the race
wouldn't really have their data on disk.  Fix this by waiting properly instead
of freeing the logged extents.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/tree-log.c