linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lightnvm: pblk: do not pad line when there are no left_msecs
@ 2019-03-18 14:38 Marcin Dziegielewski
  0 siblings, 0 replies; only message in thread
From: Marcin Dziegielewski @ 2019-03-18 14:38 UTC (permalink / raw)
  To: mb, javier, hans.holmberg
  Cc: linux-block, marcin.dziegielewski, igor.j.konopko

When there are no left msecs in line, despite it, we are
trying to pad line. In such case, pblk_recov_pad_line function
returns error, we don't write end meta to this line and
in consequence we need to scan whole line on next pblk load.

This patch fixes this issue, now when there is no left_msecs
we skip padding, write end meta and return success.

Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
---
 drivers/lightnvm/pblk-recovery.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index 83b467b..b9d7d7f 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -880,10 +880,12 @@ int pblk_recov_pad(struct pblk *pblk)
 	left_msecs = line->left_msecs;
 	spin_unlock(&l_mg->free_lock);
 
-	ret = pblk_recov_pad_line(pblk, line, left_msecs);
-	if (ret) {
-		pblk_err(pblk, "tear down padding failed (%d)\n", ret);
-		return ret;
+	if (left_msecs) {
+		ret = pblk_recov_pad_line(pblk, line, left_msecs);
+		if (ret) {
+			pblk_err(pblk, "tear down padding failed (%d)\n", ret);
+			return ret;
+		}
 	}
 
 	pblk_line_close_meta(pblk, line);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-18 14:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-18 14:38 [PATCH] lightnvm: pblk: do not pad line when there are no left_msecs Marcin Dziegielewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).