numam-spdk/test/unit
Tomasz Zawadzki 28a44891f1 lib/blob: add error path on persisting dirty bs
super->clean value signifies if blobstore was unloaded
cleanly.
If it was not, then during bs_load the _spdk_bs_recover()
procedure if called.

Meanwhile bs->clean is always set to 1 after load, causing very first
blob_persist to also re-write super block with the super->clean
set to 0. To signify that md has changed and possibly trigger
the recovery if clean bs unload does not occur.
When the re-write of super block succeeds the bs->clean is set to 0,
because further re-writes of super block are not needed on next
blob persist.

This patch resolves issue when:
1) reading super block fails - execution should backoff, to prevent
writing an empty buffer as super block !
2) writing super->clean = 0 to the super block fails - execution
again should fail, and bs->clean should not be set to 0. It will
cause next persist to attempt re-write again.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia07cc5c6c107310059b50886edb7283c176b9169
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1164
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-24 07:39:47 +00:00
..
include test/unit: remove duplicate mk/spdk.common.mk includes 2019-02-11 09:30:27 +00:00
lib lib/blob: add error path on persisting dirty bs 2020-03-24 07:39:47 +00:00
Makefile test: add histogram unit tests 2017-12-29 14:20:48 -05:00
unittest.sh lib/util: Add spdk_sn32_lt/gt() to compare two numbers based on serial number arithmetic 2020-03-19 08:51:31 +00:00