Btrfs: fix unexpected return value of bio_readpage_error
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 13 Jul 2017 22:00:50 +0000 (15:00 -0700)
committerDavid Sterba <dsterba@suse.com>
Fri, 14 Jul 2017 18:42:37 +0000 (20:42 +0200)
commitc3cfb656307583ddfea45375c10183737593c195
tree715fc49cc0671fe86c20a33ce636c623113fd14e
parente8f5b395d5332b5d720d62d33d6e06836392fd85
Btrfs: fix unexpected return value of bio_readpage_error

With blk_status_t conversion (that are now present in master),
bio_readpage_error() may return 1 as now ->submit_bio_hook() may not set
%ret if it runs without problems.

This fixes that unexpected return value by changing
btrfs_check_repairable() to return a bool instead of updating %ret, and
patch is applicable to both codebases with and without blk_status_t.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h