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)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Mar 2023 18:28:19 +0000 (19:28 +0100)
commit98e8d36a26c2ed22f78316df7d4bf33e554b9f9f
tree719c708d1b4cb4da0e1f71655fb2d007308f51c7
parentc06016a02a6e316d861f7dddd4b70419a47ded2f
btrfs: fix unnecessary increment of read error stat on write error

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: c3a62baf21ad ("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>
fs/btrfs/bio.c