[PATCH] lightnvm: pblk: do not pad line when there are no left_msecs

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

 



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@xxxxxxxxx>
---
 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




[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