From 5089a4ce5d771508c87231d9ca45b0f3c6a6d02c Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Tue, 17 Aug 2021 11:09:56 +0530 Subject: [PATCH] doc: correct some source code comments in rbd driver code Signed-off-by: Humble Chirammal --- internal/rbd/clone.go | 6 +++--- internal/rbd/controllerserver.go | 8 ++++---- internal/rbd/driver.go | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/rbd/clone.go b/internal/rbd/clone.go index 8e3a442df..d93b06e43 100644 --- a/internal/rbd/clone.go +++ b/internal/rbd/clone.go @@ -97,7 +97,7 @@ func (rv *rbdVolume) checkCloneImage(ctx context.Context, parentVol *rbdVolume) return false, err } } - // snap will be create after we flatten the temporary cloned image,no + // snap will be created after we flatten the temporary cloned image,no // need to check for flatten here. // as the snap exists,create clone image and delete temporary snapshot // and add task to flatten temporary cloned image @@ -266,8 +266,8 @@ func (rv *rbdVolume) flattenCloneImage(ctx context.Context) error { // If the intermediate clone reaches the depth we may need to return ABORT // error message as it need to be flatten before continuing, this may leak // omap entries and stale temporary snapshots in corner cases, if we reduce - // the limit and check for the depth of the parent image clain it self we - // can flatten the parent images before use to avoid the stale omap entries. + // the limit and check for the depth of the parent image clain itself we + // can flatten the parent images before used to avoid the stale omap entries. hardLimit := rbdHardMaxCloneDepth softLimit := rbdSoftMaxCloneDepth // choosing 2 so that we don't need to flatten the image in the request. diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index ee0e1d871..9a35e3e3c 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -418,7 +418,7 @@ func (cs *ControllerServer) repairExistingVolume(ctx context.Context, req *csi.C "restoring thick-provisioned volume %q has been interrupted, please retry", rbdVol) } } - // restore from snapshot imploes rbdSnap != nil + // restore from snapshot implies rbdSnap != nil // check if image depth is reached limit and requires flatten err := checkFlatten(ctx, rbdVol, cr) if err != nil { @@ -533,7 +533,7 @@ func flattenTemporaryClonedImages(ctx context.Context, rbdVol *rbdVolume, cr *ut return nil } -// checkFlatten ensures that that the image chain depth is not reached +// checkFlatten ensures that the image chain depth is not reached // hardlimit or softlimit. if the softlimit is reached it adds a task and // return success,the hardlimit is reached it starts a task to flatten the // image and return Aborted. @@ -823,7 +823,7 @@ func (cs *ControllerServer) DeleteVolume( } // lock out parallel create requests against the same volume name as we - // cleanup the image and associated omaps for the same + // clean up the image and associated omaps for the same if acquired := cs.VolumeLocks.TryAcquire(rbdVol.RequestName); !acquired { util.ErrorLog(ctx, util.VolumeOperationAlreadyExistsFmt, rbdVol.RequestName) @@ -1302,7 +1302,7 @@ func (cs *ControllerServer) DeleteSnapshot( rbdSnap := &rbdSnapshot{} if err = genSnapFromSnapID(ctx, rbdSnap, snapshotID, cr, req.GetSecrets()); err != nil { - // if error is ErrPoolNotFound, the pool is already deleted we dont + // if error is ErrPoolNotFound, the pool is already deleted we don't // need to worry about deleting snapshot or omap data, return success if errors.Is(err, util.ErrPoolNotFound) { util.WarningLog(ctx, "failed to get backend snapshot for %s: %v", snapshotID, err) diff --git a/internal/rbd/driver.go b/internal/rbd/driver.go index fc073859d..f48daabe5 100644 --- a/internal/rbd/driver.go +++ b/internal/rbd/driver.go @@ -50,11 +50,11 @@ var ( // VolumeName to backing RBD images. volJournal *journal.Config snapJournal *journal.Config - // rbdHardMaxCloneDepth is the hard limit for maximum number of nested volume clones that are taken before a flatten + // rbdHardMaxCloneDepth is the hard limit for maximum number of nested volume clones that are taken before flatten // occurs. rbdHardMaxCloneDepth uint - // rbdSoftMaxCloneDepth is the soft limit for maximum number of nested volume clones that are taken before a flatten + // rbdSoftMaxCloneDepth is the soft limit for maximum number of nested volume clones that are taken before flatten // occurs. rbdSoftMaxCloneDepth uint maxSnapshotsOnImage uint @@ -141,7 +141,7 @@ func (r *Driver) Run(conf *util.Config) { // general // In addition, we want to add the remaining modes like MULTI_NODE_READER_ONLY, // MULTI_NODE_SINGLE_WRITER etc, but need to do some verification of RO modes first - // will work those as follow up features + // will work those as follow-up features r.cd.AddVolumeCapabilityAccessModes( []csi.VolumeCapability_AccessMode_Mode{ csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER,