Actions
Bug #13214
closedceph upstart script rbdmap.conf incorrectly processes parameters
Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
common
Target version:
-
% Done:
0%
Source:
other
Tags:
Backport:
infernalis,hammer
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
The upstart script for mapping rbd devices incorrectly creates the "CMDPARAMS" value such that it becomes cumulative for every device being mapped.
while read DEV PARAMS; do case "$DEV" in ""|\#*) continue ;; */*) ;; *) DEV=rbd/$DEV ;; esac for PARAM in $(echo $PARAMS | tr ',' '\n'); do CMDPARAMS="$CMDPARAMS --$(echo $PARAM | tr '=' ' ')" done if [ ! -b /dev/rbd/$DEV ]; then echo "rbd map $DEV" rbd map $DEV $CMDPARAMS fi done < $RBDMAPFILE
See that "$CMDPARAMS" is constantly growing with each line that gets processed. It needs to be unique for each line, and not accumulate the options associated with previous lines.
Fix:
Change:
for PARAM in $(echo $PARAMS | tr ',' '\n'); do CMDPARAMS="$CMDPARAMS --$(echo $PARAM | tr '=' ' ')" done
To:
for PARAM in $(echo $PARAMS | tr ',' '\n'); do CMDPARAMS="--$(echo $PARAM | tr '=' ' ')" done
Actions