[PATCH] lightnvm: invalidate addresses on multipage fail

From: Javier GonzÃlez
Date: Mon Feb 01 2016 - 08:10:51 EST


If a page mapping fails when mapping several pages in a single write bio
request, make sure that already mapped pages are invalidated. Since
other legit mappings coming from a different bio request might have
occurred, rolling back the failed bio is a difficult, unnecessary
overhead; in part because when a mapping fails something bad has
happened already. Still, invalidating pages in the failed bio will help
GC.

Signed-off-by: Javier GonzÃlez <javier@xxxxxxxxxxxx>
---
drivers/lightnvm/rrpc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index c4d0b04..29befe9 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -730,6 +730,7 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio,
} else {
BUG_ON(is_gc);
rrpc_unlock_laddr(rrpc, r);
+ rrpc_invalidate_range(rrpc, laddr, i + 1);
nvm_dev_dma_free(rrpc->dev, rqd->ppa_list,
rqd->dma_ppa_list);
return NVM_IO_DONE;
--
2.1.4