From 0fdf94cf777bc10d5c85014d9583e4f317a4521e Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Tue, 27 Apr 2021 04:02:02 -0400 Subject: [PATCH] lib/blob: force execution of queued persists When performing snapshot creation the I/O is frozen during the process. The blob persists for extent page allocation is delayed until snapshot creation is finished. This results in multiple blob persists executing one after the other, with only intent of writing out updated extent table pointing to new extent pages. Since blob->state is marked DIRTY before issuing each persist, but a single persist completion marks state CLEAR. Blob serialize correctly expects each persist to contain dirtied metadata, in order to avoid unnecessary md writes. Since all other instances of marking blob DIRTY is explicit, assert in blob serialize is left as is. Instead when running the queued up blob persists, the blob state is marked DIRTY. Side effect is that it will write out same md in some cases. Fixes #1909 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7640 (master) (cherry picked from commit 50935184c890c205e094c73d064619c02de7455f) Change-Id: I39f37299f3f0ebfccbdd4063781b5ecce286e993 Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7677 Reviewed-by: Tomasz Zawadzki Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- lib/blob/blobstore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c index df894037b7..0278eab80e 100644 --- a/lib/blob/blobstore.c +++ b/lib/blob/blobstore.c @@ -1642,6 +1642,7 @@ blob_persist_complete(spdk_bs_sequence_t *seq, struct spdk_blob_persist_ctx *ctx free(ctx); if (next_persist != NULL) { + blob->state = SPDK_BLOB_STATE_DIRTY; blob_persist_check_dirty(next_persist); } }