]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: check for BTRFS_FS_ERROR in pending ordered assert
authorJosef Bacik <josef@toxicpanda.com>
Thu, 24 Aug 2023 20:59:04 +0000 (16:59 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 09:11:11 +0000 (11:11 +0200)
commit1f89e6daf2b0be458c3cd8a5f328a839a71581fd
tree10eadff6930d76aa94ea862db451cdd41ae6c06a
parent50e385d98b2a52480836ea41c142b81eeeb277af
btrfs: check for BTRFS_FS_ERROR in pending ordered assert

commit 4ca8e03cf2bfaeef7c85939fa1ea0c749cd116ab upstream.

If we do fast tree logging we increment a counter on the current
transaction for every ordered extent we need to wait for.  This means we
expect the transaction to still be there when we clear pending on the
ordered extent.  However if we happen to abort the transaction and clean
it up, there could be no running transaction, and thus we'll trip the
"ASSERT(trans)" check.  This is obviously incorrect, and the code
properly deals with the case that the transaction doesn't exist.  Fix
this ASSERT() to only fire if there's no trans and we don't have
BTRFS_FS_ERROR() set on the file system.

CC: stable@vger.kernel.org # 4.14+
Reviewed-by: Filipe Manana <fdmanana@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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ordered-data.c