Project

General

Profile

Bug #36327

Broken parameter parsing in /etc/ceph/rbdmap

Added by Marc Schöchlin about 1 year ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/05/2018
Due date:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
luminous,mimic
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

I would like to add a queue_depth parameter on mapping rbd devices using /etc/ceph/rbdmap.

rbd map rbd_hdd/foo-001_srv --id foo --keyring /etc/ceph/ceph.client.foo.keyring --options lock_on_read,queue_depth=1024

Add added the following line to g /etc/ceph/rbdmap:

rbd_hdd/archiv-001_srv id=archiv,keyring=/etc/ceph/ceph.client.archiv.keyring,options=lock_on_read,queue_depth=1024

This does not work, because the options parsing of "/usr/bin/rbdmap" (https://github.com/ceph/ceph/blob/master/src/rbdmap) is too simple.
Placing a "set -x" before the "rbd map" command results to a broken command:

# rbdmap map
++ rbd map rbd_hdd/foo-001_srv --id foo --keyring /etc/ceph/ceph.client.foo.keyring --options '"lock_on_read' --queue_depth '1024"'
+ MAP_RV='rbd: unrecognised option '\''--queue_depth'\'''
+ '[' 1 -eq 0 ']'
+ RET=1

Related issues

Copied to rbd - Backport #37925: mimic: Broken parameter parsing in /etc/ceph/rbdmap Resolved
Copied to rbd - Backport #37926: luminous: Broken parameter parsing in /etc/ceph/rbdmap Resolved

History

#1 Updated by Marc Schöchlin about 1 year ago

Wrote a (hopefully better) parsing function.

Sent a pull request: https://github.com/ceph/ceph/pull/24446

#2 Updated by Marc Schöchlin about 1 year ago

Test expressions:

    PARAMS="options='lock_on_read,queue_depth=1024',id=archiv,keyring=/etc/ceph/ceph.client.archiv.keyring" 
    echo -e " ORIGINAL PARAM: >>>$PARAMS<<<\nCONVERTED PARAM: >>>$(create_cmd_params "$PARAMS")<<<" 

    PARAMS="id=archiv,keyring=/etc/ceph/ceph.client.archiv.keyring,options='lock_on_read,queue_depth=1024'" 
    echo -e " ORIGINAL PARAM: >>>$PARAMS<<<\nCONVERTED PARAM: >>>$(create_cmd_params "$PARAMS")<<<" 

    PARAMS="" 
    echo -e " ORIGINAL PARAM: >>>$PARAMS<<<\nCONVERTED PARAM: >>>$(create_cmd_params "$PARAMS")<<<" 

    PARAMS=",keyring=/etc/ceph/ceph.client.archiv.keyring,options='lock_on_read,queue_depth=1024',id=archiv," 
    echo -e " ORIGINAL PARAM: >>>$PARAMS<<<\nCONVERTED PARAM: >>>$(create_cmd_params "$PARAMS")<<<" 

    PARAMS="'keyring'=/etc/ceph/ceph.client.archiv.keyring,options='lock_on_read,queue_depth=1024',id=archiv," 
    echo -e " ORIGINAL PARAM: >>>$PARAMS<<<\nCONVERTED PARAM: >>>$(create_cmd_params "$PARAMS")<<<" 

    PARAMS="--keyring=/etc/ceph/ceph.client.archiv.keyring,options='lock_on_read,queue_depth=1024',id=archiv, # a comment" 
    echo -e " ORIGINAL PARAM: >>>$PARAMS<<<\nCONVERTED PARAM: >>>$(create_cmd_params "$PARAMS")<<<" 

#3 Updated by Greg Farnum about 1 year ago

  • Project changed from Ceph to rbd
  • Category deleted (common)

#4 Updated by Mykola Golub about 1 year ago

  • Status changed from New to Need Review

#5 Updated by Jason Dillaman 9 months ago

  • Status changed from Need Review to Pending Backport
  • Target version deleted (v12.2.9)
  • Backport set to luminous,mimic

#6 Updated by Nathan Cutler 9 months ago

  • Copied to Backport #37925: mimic: Broken parameter parsing in /etc/ceph/rbdmap added

#7 Updated by Nathan Cutler 9 months ago

  • Copied to Backport #37926: luminous: Broken parameter parsing in /etc/ceph/rbdmap added

#8 Updated by Nathan Cutler 8 months ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF