From: Igor Konopko <igor.j.konopko@intel.com>
To: mb@lightnvm.io, javier@javigon.com, hans.holmberg@cnexlabs.com
Cc: linux-block@vger.kernel.org, igor.j.konopko@intel.com
Subject: [PATCH v3 04/10] lightnvm: pblk: recover only written metadata
Date: Wed, 27 Mar 2019 13:38:55 +0100 [thread overview]
Message-ID: <20190327123901.12323-5-igor.j.konopko@intel.com> (raw)
In-Reply-To: <20190327123901.12323-1-igor.j.konopko@intel.com>
This patch ensures that smeta was fully written before even
trying to read it based on chunk table state and write pointer.
Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
---
drivers/lightnvm/pblk-recovery.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index 124d817..9318f7a 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -661,10 +661,12 @@ static int pblk_line_was_written(struct pblk_line *line,
bppa = pblk->luns[smeta_blk].bppa;
chunk = &line->chks[pblk_ppa_to_pos(geo, bppa)];
- if (chunk->state & NVM_CHK_ST_FREE)
- return 0;
+ if (chunk->state & NVM_CHK_ST_CLOSED ||
+ (chunk->state & NVM_CHK_ST_OPEN
+ && chunk->wp >= lm->smeta_sec))
+ return 1;
- return 1;
+ return 0;
}
static bool pblk_line_is_open(struct pblk *pblk, struct pblk_line *line)
--
2.9.5
next prev parent reply other threads:[~2019-03-27 12:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-27 12:38 [PATCH v3 00/10] lightnvm: next set of improvements for 5.2 Igor Konopko
2019-03-27 12:38 ` [PATCH v3 01/10] lightnvm: pblk: IO path reorganization Igor Konopko
2019-03-27 12:38 ` [PATCH v3 02/10] lightnvm: pblk: simplify partial read path Igor Konopko
2019-03-29 9:12 ` Hans Holmberg
2019-03-30 5:02 ` Heiner Litz
2019-04-01 15:29 ` Igor Konopko
2019-03-27 12:38 ` [PATCH v3 03/10] lightnvm: pblk: propagate errors when reading meta Igor Konopko
2019-03-27 20:25 ` Matias Bjørling
2019-03-27 12:38 ` Igor Konopko [this message]
2019-03-27 12:38 ` [PATCH v3 05/10] lightnvm: pblk: wait for inflight IOs in recovery Igor Konopko
2019-03-27 12:38 ` [PATCH v3 06/10] lightnvm: pblk: remove internal IO timeout Igor Konopko
2019-03-27 12:38 ` [PATCH v3 07/10] lightnvm: pblk: store multiple copies of smeta Igor Konopko
2019-03-27 12:38 ` [PATCH v3 08/10] lightnvm: pblk: GC error handling Igor Konopko
2019-03-27 12:39 ` [PATCH v3 09/10] lightnvm: pblk: use nvm_rq_to_ppa_list() Igor Konopko
2019-03-27 12:39 ` [PATCH v3 10/10] lightnvm: track inflight target creations Igor Konopko
2019-04-05 13:48 ` Matias Bjørling
2019-04-03 7:12 ` [PATCH v3 00/10] lightnvm: next set of improvements for 5.2 Hans Holmberg
2019-04-05 6:31 ` Igor Konopko
2019-04-05 13:40 ` Matias Bjørling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190327123901.12323-5-igor.j.konopko@intel.com \
--to=igor.j.konopko@intel.com \
--cc=hans.holmberg@cnexlabs.com \
--cc=javier@javigon.com \
--cc=linux-block@vger.kernel.org \
--cc=mb@lightnvm.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox