Skip to contentSkip to conversation

lightnvm: check bi_error in gc

PATCH In review Wenwei Tao 2 participants 2 messages Dec 29, 2015

lore
Share & tools
lore

Wenwei Tao

author
#0 lore raw

PATCH 1/1 lightnvm: check bi_error in gc

We should check last io compeltion status before
start another one.

---
 drivers/lightnvm/rrpc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/lightnvm/rrpc.c +6 -0
index c0886a8..d40c140 100644
@@ -328,6 +328,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);
@@ -350,6 +354,8 @@ try:
 		wait_for_completion_io(&wait);
 
 		rrpc_inflight_laddr_release(rrpc, rqd);
+		if (bio->bi_error)
+			goto finished;
 
 		bio_reset(bio);
 	}
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 25 lines · Wenwei Tao

We should check last io compeltion status before
start another one.

---
  drivers/lightnvm/rrpc.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/lightnvm/rrpc.c +4 -0
index c0886a8..d40c140 100644
@@ -328,6 +328,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);

drivers/lightnvm/rrpc.c try: · line 361

Quoted 8 lines
drivers/lightnvm/rrpc.c +2 -0
@@ -350,6 +354,8 @@ try:
  		wait_for_completion_io(&wait);
 
  		rrpc_inflight_laddr_release(rrpc, rqd);
+		if (bio->bi_error)
+			goto finished;
 
  		bio_reset(bio);
  	}

Thanks Tao. I've applied it for 4.5.