]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: check error value from btrfs_update_inode in tree log
authorJosef Bacik <josef@toxicpanda.com>
Wed, 19 May 2021 15:26:25 +0000 (11:26 -0400)
committerDavid Sterba <dsterba@suse.com>
Thu, 27 May 2021 21:31:13 +0000 (23:31 +0200)
commit74d6b59d168d8ab4d1629a26bb22f8c630d65667
tree47b7b72f50c223f6b34da8ca0ed85a50e3aa3a58
parenta786f148f38c54ba18d18ac3fe7689d8ec92687f
btrfs: check error value from btrfs_update_inode in tree log

Error injection testing uncovered a case where we ended up with invalid
link counts on an inode.  This happened because we failed to notice an
error when updating the inode while replaying the tree log, and
committed the transaction with an invalid file system.

Fix this by checking the return value of btrfs_update_inode.  This
resolved the link count errors I was seeing, and we already properly
handle passing up the error values in these paths.

CC: stable@vger.kernel.org # 4.4+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c