提交 e37d0798 编写于 作者: J Javier González 提交者: Jens Axboe

lightnvm: pblk: warn in case of corrupted write buffer

When cleaning up buffer entries as we wrap up, their state should be
"completed". If any of the entries is in "submitted" state, it means
that something bad has happened. Trigger a warning immediately instead of
waiting for the state flag to eventually be updated, thus hiding the
issue.
Signed-off-by: NJavier González <javier@cnexlabs.com>
Signed-off-by: NMatias Bjørling <mb@lightnvm.io>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 03a34b2d
...@@ -142,10 +142,9 @@ static void clean_wctx(struct pblk_w_ctx *w_ctx) ...@@ -142,10 +142,9 @@ static void clean_wctx(struct pblk_w_ctx *w_ctx)
{ {
int flags; int flags;
try:
flags = READ_ONCE(w_ctx->flags); flags = READ_ONCE(w_ctx->flags);
if (!(flags & PBLK_SUBMITTED_ENTRY)) WARN_ONCE(!(flags & PBLK_SUBMITTED_ENTRY),
goto try; "pblk: overwriting unsubmitted data\n");
/* Release flags on context. Protect from writes and reads */ /* Release flags on context. Protect from writes and reads */
smp_store_release(&w_ctx->flags, PBLK_WRITABLE_ENTRY); smp_store_release(&w_ctx->flags, PBLK_WRITABLE_ENTRY);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册