diff mbox

[05/11] lightnvm: pblk: warn in case of corrupted write buffer

Message ID 1525079409-6588-6-git-send-email-javier@cnexlabs.com (mailing list archive)
State New, archived
Headers show

Commit Message

Javier González April 30, 2018, 9:10 a.m. UTC
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

Signed-off-by: Javier González <javier@cnexlabs.com>
 drivers/lightnvm/pblk-rb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox


diff --git a/drivers/lightnvm/pblk-rb.c b/drivers/lightnvm/pblk-rb.c
index 7a632913475f..024a366a995c 100644
--- a/drivers/lightnvm/pblk-rb.c
+++ b/drivers/lightnvm/pblk-rb.c
@@ -142,10 +142,9 @@  static void clean_wctx(struct pblk_w_ctx *w_ctx)
 	int flags;
 	flags = READ_ONCE(w_ctx->flags);
-	if (!(flags & PBLK_SUBMITTED_ENTRY))
-		goto try;
+			"pblk: overwriting unsubmitted data\n");
 	/* Release flags on context. Protect from writes and reads */
 	smp_store_release(&w_ctx->flags, PBLK_WRITABLE_ENTRY);