]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix unnecessary increment of read error stat on write error
authorNaohiro Aota <naohiro.aota@wdc.com>
Mon, 13 Feb 2023 05:10:38 +0000 (14:10 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:14 +0000 (08:50 +0100)
commit6763202d756463e99501d840406083c066ba6051
treeb92dbb6c1f8ff6b8d8e9ee8db2c5e379712a2e18
parent1a3d1e82618ece529749edfe5c2e54b2fc865aec
btrfs: fix unnecessary increment of read error stat on write error

commit 1c9d3333c8d0e77f411285fa76175ca8a63320ba upstream.

Current btrfs_log_dev_io_error() increases the read error count even if the
erroneous IO is a WRITE request. This is because it forget to use "else
if", and all the error WRITE requests counts as READ error as there is (of
course) no REQ_RAHEAD bit set.

Fixes: a2e928f27856 ("btrfs: use chained bios when cloning")
CC: stable@vger.kernel.org # 6.1+
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.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/volumes.c