Commit 2b11c1b2 authored by Wenwei Tao's avatar Wenwei Tao Committed by Jens Axboe

lightnvm: check bi_error in gc

We should check last io completion status before
starting another one.
Signed-off-by: default avatarWenwei Tao <ww.tao0320@gmail.com>
Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 22513215
...@@ -330,6 +330,10 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk) ...@@ -330,6 +330,10 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk)
goto finished; goto finished;
} }
wait_for_completion_io(&wait); wait_for_completion_io(&wait);
if (bio->bi_error) {
rrpc_inflight_laddr_release(rrpc, rqd);
goto finished;
}
bio_reset(bio); bio_reset(bio);
reinit_completion(&wait); reinit_completion(&wait);
...@@ -352,6 +356,8 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk) ...@@ -352,6 +356,8 @@ static int rrpc_move_valid_pages(struct rrpc *rrpc, struct rrpc_block *rblk)
wait_for_completion_io(&wait); wait_for_completion_io(&wait);
rrpc_inflight_laddr_release(rrpc, rqd); rrpc_inflight_laddr_release(rrpc, rqd);
if (bio->bi_error)
goto finished;
bio_reset(bio); bio_reset(bio);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment