summaryrefslogtreecommitdiff
path: root/certs
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-05-19 17:52:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-10 13:43:51 +0300
commitd7178ad2ceb6ae207ce91feaf8820bad64f238c4 (patch)
tree7f5273a0bad61b4430f40d61d4a51b2765507219 /certs
parentffff05b9ee5c74c04bba2801c1f99b31975d74d9 (diff)
downloadlinux-d7178ad2ceb6ae207ce91feaf8820bad64f238c4.tar.xz
btrfs: fix error handling in btrfs_del_csums
commit b86652be7c83f70bf406bed18ecf55adb9bfb91b upstream. Error injection stress would sometimes fail with checksums on disk that did not have a corresponding extent. This occurred because the pattern in btrfs_del_csums was while (1) { ret = btrfs_search_slot(); if (ret < 0) break; } ret = 0; out: btrfs_free_path(path); return ret; If we got an error from btrfs_search_slot we'd clear the error because we were breaking instead of goto out. Instead of using goto out, simply handle the cases where we may leave a random value in ret, and get rid of the ret = 0; out: pattern and simply allow break to have the proper error reporting. With this fix we properly abort the transaction and do not commit thinking we successfully deleted the csum. Reviewed-by: Qu Wenruo <wqu@suse.com> CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'certs')
0 files changed, 0 insertions, 0 deletions