summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2017-11-17 14:50:46 -0500
committerBen Hutchings <ben@decadent.org.uk>2018-03-03 15:51:32 +0000
commit65b373b92f22206ed007fa7e48b464dd35aae716 (patch)
treea523e1021e88d9dbc4f7d3b69c734a6b17e1312f /include/linux
parent18618d28f7055b05219967da30308b9611700432 (diff)
btrfs: clear space cache inode generation always
commit 8e138e0d92c6c9d3d481674fb14e3439b495be37 upstream. We discovered a box that had double allocations, and suspected the space cache may be to blame. While auditing the write out path I noticed that if we've already setup the space cache we will just carry on. This means that any error we hit after cache_save_setup before we go to actually write the cache out we won't reset the inode generation, so whatever was already written will be considered correct, except it'll be stale. Fix this by _always_ resetting the generation on the block group inode, this way we only ever have valid or invalid cache. With this patch I was no longer able to reproduce cache corruption with dm-log-writes and my bpf error injection tool. Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions