btrfs: don't WARN if we abort a transaction with EROFS
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 15:24:27 +0000 (11:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:07:21 +0000 (13:07 +0200)
commitb75c439472a808d552f603b61d8fa5d90dd7de6f
tree951f78e830b682bdd7879165d6a06e25c7764dcf
parent758afd58b62b967d0f6dd3aee4d5e64625894b9f
btrfs: don't WARN if we abort a transaction with EROFS

commit f95ebdbed46a4d8b9fdb7bff109fdbb6fc9a6dc8 upstream.

If we got some sort of corruption via a read and call
btrfs_handle_fs_error() we'll set BTRFS_FS_STATE_ERROR on the fs and
complain.  If a subsequent trans handle trips over this it'll get EROFS
and then abort.  However at that point we're not aborting for the
original reason, we're aborting because we've been flipped read only.
We do not need to WARN_ON() here.

CC: stable@vger.kernel.org # 5.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>
fs/btrfs/ctree.h