Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
98dda6ef
Commit
98dda6ef
authored
May 07, 2013
by
Kirk Webb
Browse files
Fix nested mountpoint comparison.
parent
370c7688
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/ns2ir/blockstore.tcl
View file @
98dda6ef
...
...
@@ -285,11 +285,25 @@ Blockstore instproc finalize {} {
if
{
!
[
info exists sonodemounts
(
$node
)]}
{
set sonodemounts
(
$node
)
{}
}
# Look through all mount points for blockstores attached to the same
# node as this blockstore.
set mplist
[
lreplace
[
split $mymount
"/"
]
0 0
]
foreach nodemount $sonodemounts
(
$node
)
{
set nmlen
[
string length $nodemount
]
set mplen
[
string length $mymount
]
set minlen
[
expr
{
$nmlen
< $mplen ? $nmlen : $mplen
}]
if
{[
string compare -length $minlen $nodemount $mymount
]
== 0
}
{
set nmlist
[
lreplace
[
split $nodemount
"/"
]
0 0
]
set diff 0
# Look for any differences in path components. If one is a
# matching prefix of the other, then the mount is nested or
# identical.
foreach nmcomp $nmlist mpcomp $mplist
{
# Have we hit the end of the list for one or the other?
if
{
$nmcomp
==
{}
|| $mpcomp ==
{}}
{
break
}
elseif
{
$nmcomp
!= $mpcomp
}
{
set diff 1
break
}
}
if
{
!$diff
}
{
perror
"Mount collision or nested mount detected on
$node:
$mymount
,
$nodemount
"
return
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment