Spdk/module/bdev/ocf
Vitaliy Mysak 9f133b1bcc module/ocf: check cache name during recovery from metadata
Save cache device name in metadata section to
check if names agree during auto creation on examine.

This change prevents accidental creation of ocf devices.

Consider example in which vbdev_split is used as cache:
1) bdev_malloc_create -b Malloc0 ...
2) bdev_malloc_create -b Malloc1 ...
3) bdev_nvme_attach_controller -b nvme ...
4) bdev_split_create nvme 2
5) bdev_ocf_create ocf0 wt nvmen1p0 Malloc0
6) bdev_ocf_create ocf1 wt nvmen1p1 Malloc1
7) *shutdown*
8) *startup*
9) bdev_nvme_attach_controller -b nvme
Now ocf0 bdev gets created with cache = nvmen1 (not nvmen1p0)!

This is because nvmen1 and nvmen1p0 have the same metadata.
The result is rather unexpected,
so we would like to verify that cache device
is the one used during creation.
Name is not an ideal way to verify that,
but it should work for most cases.

This change is related to issue #1320

Change-Id: I19ce97163090c5c5b3324eaed90b3134011bb3fb
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1544
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-10 07:08:50 +00:00
..
ctx.c lib/bdev/ocf: update of ocf library to version 19.06 2019-10-22 17:22:41 +00:00
ctx.h lib/bdev/ocf: fix potential issue around base->management_channel 2019-10-18 17:31:39 +00:00
data.c mk: move the bdev modules under module directory. 2019-08-22 16:29:49 +00:00
data.h mk: move the bdev modules under module directory. 2019-08-22 16:29:49 +00:00
Makefile make: rev SO versions individually for libraries. 2020-03-18 08:02:30 +00:00
stats.c lib/bdev/ocf: update of ocf library to version 19.06 2019-10-22 17:22:41 +00:00
stats.h mk: move the bdev modules under module directory. 2019-08-22 16:29:49 +00:00
utils.c lib/bdev/ocf: remove unused code related to polling utils 2019-10-22 17:22:41 +00:00
utils.h lib/bdev/ocf: increase capabilites of vbdev_ocf_mngt_stop function 2019-10-22 17:22:41 +00:00
vbdev_ocf_rpc.c lib/bdev/ocf: update of ocf library to version 19.06 2019-10-22 17:22:41 +00:00
vbdev_ocf.c module/ocf: check cache name during recovery from metadata 2020-04-10 07:08:50 +00:00
vbdev_ocf.h vbdev: close the base bdev on its opened thread 2020-02-25 10:46:40 +00:00
volume.c thread: remove io_channel.h public header 2020-03-10 09:12:53 +00:00
volume.h mk: move the bdev modules under module directory. 2019-08-22 16:29:49 +00:00