Bug #13214
ceph upstart script rbdmap.conf incorrectly processes parameters
0%
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
Related issues
Associated revisions
init-rbdmap: fix CMDPARAMS
Fixes: #13214
Reported-by: Wyllys Ingersoll <wyllys.ingersoll@keepertech.com>
Signed-off-by: Sage Weil <sage@redhat.com>
init-rbdmap: fix CMDPARAMS
Fixes: #13214
Reported-by: Wyllys Ingersoll <wyllys.ingersoll@keepertech.com>
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 02113ac449cd7631f1c9a3840c94bbf253c052bd)
init-rbdmap: fix CMDPARAMS
Fixes: #13214
Reported-by: Wyllys Ingersoll <wyllys.ingersoll@keepertech.com>
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 02113ac449cd7631f1c9a3840c94bbf253c052bd)
History
#1 Updated by Wyllys Ingersoll over 7 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
#2 Updated by Loïc Dachary over 7 years ago
- Target version deleted (
v0.94.4)
#3 Updated by Sage Weil over 7 years ago
- Status changed from New to Fix Under Review
- Backport set to hammer
#4 Updated by Sage Weil over 7 years ago
- Status changed from Fix Under Review to Pending Backport
- Backport changed from hammer to infernalis,hammer
#5 Updated by Loïc Dachary about 7 years ago
- Status changed from Pending Backport to Resolved