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
Updated by Wyllys Ingersoll over 8 years ago
Correction, the fix is to make sure CMDPARAMS is reset for each new set of parameters being processed:
CMDPARAMS="" for PARAM in $(echo $PARAMS | tr ',' '\n'); do CMDPARAMS="$CMDPARAMS --$(echo $PARAM | tr '=' ' ')" done
Updated by Sage Weil over 8 years ago
- Status changed from New to Fix Under Review
- Backport set to hammer
Updated by Sage Weil over 8 years ago
- Status changed from Fix Under Review to Pending Backport
- Backport changed from hammer to infernalis,hammer
Updated by Loïc Dachary over 8 years ago
- Status changed from Pending Backport to Resolved
Actions