Re: [PATCH 04/13] lightnvm: pblk: Rollback in gc read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/27/19 6:14 PM, Igor Konopko wrote:
Currently in case of error returned by pblk_gc_line
to pblk_gc_read we leave current line unassigned
from all the lists. This patch fixes that issue.

Signed-off-by: Igor Konopko <igor.j.konopko@xxxxxxxxx>
---
  drivers/lightnvm/pblk-gc.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c
index 511ed0d5333c..533da6ea3e15 100644
--- a/drivers/lightnvm/pblk-gc.c
+++ b/drivers/lightnvm/pblk-gc.c
@@ -361,8 +361,13 @@ static int pblk_gc_read(struct pblk *pblk)
pblk_gc_kick(pblk); - if (pblk_gc_line(pblk, line))
+	if (pblk_gc_line(pblk, line)) {
  		pblk_err(pblk, "failed to GC line %d\n", line->id);
+		/* rollback */
+		spin_lock(&gc->r_lock);
+		list_add_tail(&line->list, &gc->r_list);
+		spin_unlock(&gc->r_lock);
+	}
return 0;
  }


Thanks Igor. I've reworded your description a bit. Applied for 5.2.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux