Project

General

Profile

Bug #13214

ceph upstart script rbdmap.conf incorrectly processes parameters

Added by Wyllys Ingersoll about 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
common
Target version:
-
Start date:
09/23/2015
Due date:
% Done:

0%

Estimated time:
0.50 h
Source:
other
Tags:
Backport:
infernalis,hammer
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

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

Copied to Ceph - Backport #13341: ceph upstart script rbdmap.conf incorrectly processes parameters Resolved
Copied to Ceph - Backport #13342: ceph upstart script rbdmap.conf incorrectly processes parameters Resolved

Associated revisions

Revision 02113ac4 (diff)
Added by Sage Weil about 3 years ago

init-rbdmap: fix CMDPARAMS

Fixes: #13214
Reported-by: Wyllys Ingersoll <>
Signed-off-by: Sage Weil <>

Revision 6e29e904 (diff)
Added by Sage Weil about 3 years ago

init-rbdmap: fix CMDPARAMS

Fixes: #13214
Reported-by: Wyllys Ingersoll <>
Signed-off-by: Sage Weil <>
(cherry picked from commit 02113ac449cd7631f1c9a3840c94bbf253c052bd)

Revision a2c6a212 (diff)
Added by Sage Weil about 3 years ago

init-rbdmap: fix CMDPARAMS

Fixes: #13214
Reported-by: Wyllys Ingersoll <>
Signed-off-by: Sage Weil <>
(cherry picked from commit 02113ac449cd7631f1c9a3840c94bbf253c052bd)

History

#1 Updated by Wyllys Ingersoll about 3 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 Loic Dachary about 3 years ago

  • Target version deleted (v0.94.4)

#3 Updated by Sage Weil about 3 years ago

  • Status changed from New to Need Review
  • Backport set to hammer

#4 Updated by Sage Weil about 3 years ago

  • Status changed from Need Review to Pending Backport
  • Backport changed from hammer to infernalis,hammer

#5 Updated by Loic Dachary almost 3 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF