diff mbox

[09/25] lightnvm: check bi_error in gc

Message ID 1452581379-18162-10-git-send-email-m@bjorling.me (mailing list archive)
State Accepted, archived
Delegated to: Jens Axboe
Headers show

Commit Message

Matias Bjørling Jan. 12, 2016, 6:49 a.m. UTC
From: Wenwei Tao <ww.tao0320@gmail.com>

We should check last io completion status before
starting another one.

Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 drivers/lightnvm/rrpc.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index 661c6f3..5df4a69 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -330,6 +330,10 @@  try:
 			goto finished;
 		}
 		wait_for_completion_io(&wait);
+		if (bio->bi_error) {
+			rrpc_inflight_laddr_release(rrpc, rqd);
+			goto finished;
+		}
 
 		bio_reset(bio);
 		reinit_completion(&wait);
@@ -352,6 +356,8 @@  try:
 		wait_for_completion_io(&wait);
 
 		rrpc_inflight_laddr_release(rrpc, rqd);
+		if (bio->bi_error)
+			goto finished;
 
 		bio_reset(bio);
 	}