bcachefs: Fix an unhandled transaction restart
__bch2_read() -> __bch2_read_extent() -> bch2_bucket_io_time_reset() may cause a transaction restart, which we don't return an error for because it doesn't prevent us from making forward progress on the read we're submitting. Instead, change __bch2_read() and bchfs_read() to check for transaction restarts. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
e363726602
commit
3737e0ddfb
@ -791,6 +791,15 @@ retry:
|
||||
unsigned bytes, sectors, offset_into_extent;
|
||||
enum btree_id data_btree = BTREE_ID_extents;
|
||||
|
||||
/*
|
||||
* read_extent -> io_time_reset may cause a transaction restart
|
||||
* without returning an error, we need to check for that here:
|
||||
*/
|
||||
if (!bch2_trans_relock(trans)) {
|
||||
ret = -EINTR;
|
||||
break;
|
||||
}
|
||||
|
||||
bch2_btree_iter_set_pos(iter,
|
||||
POS(inum, rbio->bio.bi_iter.bi_sector));
|
||||
|
||||
|
@ -2288,6 +2288,15 @@ retry:
|
||||
unsigned bytes, sectors, offset_into_extent;
|
||||
enum btree_id data_btree = BTREE_ID_extents;
|
||||
|
||||
/*
|
||||
* read_extent -> io_time_reset may cause a transaction restart
|
||||
* without returning an error, we need to check for that here:
|
||||
*/
|
||||
if (!bch2_trans_relock(&trans)) {
|
||||
ret = -EINTR;
|
||||
break;
|
||||
}
|
||||
|
||||
bch2_btree_iter_set_pos(iter,
|
||||
POS(inode, bvec_iter.bi_sector));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user