From 6bc4a314aeacab5fa11f03e563e8beb551ab26f0 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Thu, 6 Sep 2018 08:08:23 +0900 Subject: [PATCH] bdev/raid: Update the comment of raid_bdev_add_base_bdevs() Implementation was updated by the previous patch series but the comment was not. Hence update the comment in this patch. Change-Id: Ib2097561501984c4ad213652ba716ce195c7bea5 Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/424737 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Kunal Sablok Reviewed-by: Ben Walker --- lib/bdev/raid/bdev_raid.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/bdev/raid/bdev_raid.c b/lib/bdev/raid/bdev_raid.c index 3699a7682..147b926b3 100644 --- a/lib/bdev/raid/bdev_raid.c +++ b/lib/bdev/raid/bdev_raid.c @@ -1373,14 +1373,17 @@ raid_bdev_add_base_device(struct raid_bdev_config *raid_cfg, struct spdk_bdev *b /* * brief: - * iterate the raid bdev config and add base bdevs to the raid bdev that - * the config has. Skip nonexistent base bdev but stop iteration and - * return failure if adding base bdev fails. + * Add base bdevs to the raid bdev one by one. Skip any base bdev which doesn't + * exist or fails to add. If all base bdevs are successfully added, the raid bdev + * moves to the configured state and becomes available. Otherwise, the raid bdev + * stays at the configuring state with added base bdevs. * params: * raid_cfg - pointer to raid bdev config * returns: - * 0 - success - * non zero - failure + * 0 - The raid bdev moves to the configured state or stays at the configuring + * state with added base bdevs due to any nonexistent base bdev. + * non zero - Failed to add any base bdev and stays at the configuring state with + * added base bdevs. */ int raid_bdev_add_base_devices(struct raid_bdev_config *raid_cfg) @@ -1390,7 +1393,6 @@ raid_bdev_add_base_devices(struct raid_bdev_config *raid_cfg) int rc = 0, _rc; for (i = 0; i < raid_cfg->num_base_bdevs; i++) { - /* Check if base_bdev exists already, if not fail the command */ base_bdev = spdk_bdev_get_by_name(raid_cfg->base_bdev[i].name); if (base_bdev == NULL) { SPDK_DEBUGLOG(SPDK_LOG_BDEV_RAID, "base bdev %s doesn't exist now\n", @@ -1398,11 +1400,6 @@ raid_bdev_add_base_devices(struct raid_bdev_config *raid_cfg) continue; } - /* - * Try to add base_bdev to this raid bdev, if not able to add fail the - * command. This might be because this base_bdev may already be claimed - * by some other module - */ _rc = raid_bdev_add_base_device(raid_cfg, base_bdev, i); if (_rc != 0) { SPDK_ERRLOG("Failed to add base bdev %s to RAID bdev %s: %s",