mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 15:20:41 +00:00
lightnvm: pblk: warn in case of corrupted write buffer
[ Upstream commit e37d07983a
]
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: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
929e1a3906
commit
4f5fd8a1ae
1 changed files with 2 additions and 3 deletions
|
@ -142,10 +142,9 @@ static void clean_wctx(struct pblk_w_ctx *w_ctx)
|
|||
{
|
||||
int flags;
|
||||
|
||||
try:
|
||||
flags = READ_ONCE(w_ctx->flags);
|
||||
if (!(flags & PBLK_SUBMITTED_ENTRY))
|
||||
goto try;
|
||||
WARN_ONCE(!(flags & PBLK_SUBMITTED_ENTRY),
|
||||
"pblk: overwriting unsubmitted data\n");
|
||||
|
||||
/* Release flags on context. Protect from writes and reads */
|
||||
smp_store_release(&w_ctx->flags, PBLK_WRITABLE_ENTRY);
|
||||
|
|
Loading…
Reference in a new issue