@@ -368,7 +368,7 @@ func (m *Mounter) reload(device string, newM *Info) error {
368
368
}
369
369
370
370
// Purge old mounts.
371
- logrus .Infof ("Reload: Adding the device tuple { %v:%v] to mount table" , device , newM .Fs )
371
+ logrus .Infof ("Reload: Adding the device tuple [ %v:%v] to mount table" , device , newM .Fs )
372
372
m .mounts [device ] = newM
373
373
return nil
374
374
}
@@ -387,12 +387,15 @@ func (m *Mounter) load(prefixes []*regexp.Regexp, fmp findMountPoint) error {
387
387
foundPrefix , sourcePath , devicePath = fmp (v , devPrefix , info )
388
388
targetDevice = getTargetDevice (devPrefix .String ())
389
389
if ! foundPrefix && targetDevice != "" {
390
- foundTarget , _ , _ = fmp (v , regexp .MustCompile (regexp .QuoteMeta (targetDevice )), info )
391
- // We could not find a mountpoint for devPrefix (/dev/mapper/vg-lvm1) but found
392
- // one for its target device (/dev/dm-0). Change the sourcePath to devPrefix
393
- // as fmp might have returned an incorrect or empty sourcePath
394
- sourcePath = devPrefix .String ()
395
- devicePath = devPrefix .String ()
390
+ // This should be an Exact Match and not a prefix match.
391
+ if strings .EqualFold (targetDevice , v .Source ) {
392
+ // We could not find a mountpoint for devPrefix (/dev/mapper/vg-lvm1) but found
393
+ // one for its target device (/dev/dm-0). Change the sourcePath to devPrefix
394
+ // as fmp might have returned an incorrect or empty sourcePath
395
+ sourcePath = devPrefix .String ()
396
+ devicePath = devPrefix .String ()
397
+ foundTarget = true
398
+ }
396
399
}
397
400
398
401
if foundPrefix || foundTarget {
0 commit comments