Project

General

Profile

Actions

Bug #13214

closed

ceph upstart script rbdmap.conf incorrectly processes parameters

Added by Wyllys Ingersoll over 8 years ago. Updated over 8 years ago.

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


Related issues 2 (0 open2 closed)

Copied to Ceph - Backport #13341: ceph upstart script rbdmap.conf incorrectly processes parametersResolvedLoïc DacharyActions
Copied to Ceph - Backport #13342: ceph upstart script rbdmap.conf incorrectly processes parametersResolvedSage WeilActions
Actions #1

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

Actions #2

Updated by Loïc Dachary over 8 years ago

  • Target version deleted (v0.94.4)
Actions #3

Updated by Sage Weil over 8 years ago

  • Status changed from New to Fix Under Review
  • Backport set to hammer
Actions #4

Updated by Sage Weil over 8 years ago

  • Status changed from Fix Under Review to Pending Backport
  • Backport changed from hammer to infernalis,hammer
Actions #5

Updated by Loïc Dachary over 8 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF