]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: bring back repair during read
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 24 Mar 2017 22:04:50 +0000 (15:04 -0700)
committerDavid Sterba <dsterba@suse.com>
Wed, 29 Mar 2017 12:29:07 +0000 (14:29 +0200)
commite10593e526a38a1269bb8ca14dcdd498a56c55b8
treec3246e651c9e3fd1212853a199e25229ce09cb3c
parent495b4a53286f1299948cf2ff3c8da0dc8ac33cce
Btrfs: bring back repair during read

Commit 9d7e188d66f9 ("btrfs: add dummy callback for readpage_io_failed
and drop checks") made a cleanup around readpage_io_failed_hook, and
it was supposed to keep the original sematics, but it also
unexpectedly disabled repair during read for dup, raid1 and raid10.

This fixes the problem by letting data's inode call the generic
readpage_io_failed callback by returning -EAGAIN from its
readpage_io_failed_hook in order to notify end_bio_extent_readpage to
do the rest.  We don't call it directly because the generic one takes
an offset from end_bio_extent_readpage() to calculate the index in the
checksum array and inode's readpage_io_failed_hook doesn't offer that
offset.

Cc: David Sterba <dsterba@suse.cz>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ keep the const function attribute ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/inode.c