-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create: check the StorageObject's existence before creating
This will fix the following issues: 1, When the StorageObject creation failed the iqn will still be created and won't be deleted in case of: When creating BVs with the same NAME, the second time it will fail duing to the targetcli cache db only allows one [user/$NAME] exist, and then fails it leaving the IQN not deleted correctly. That means there will be two different IQNs both mapped to the same StorageObject. 2, For the case above we will also find that after the second creation failing in the /etc/target/saveconfig.json there will be one StorageObject with the two Targets. In theory, there should be one StorageObject with only 1 Target. This patch will check all the StorageObjects in saveconfig.json before creating, if there already has one StorageObject with the same NAME requested, it will fail directly. Signed-off-by: Xiubo Li <[email protected]> Reviewed-by: Prasanna Kumar Kalever <[email protected]>
- Loading branch information
Showing
2 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters