Project

General

Profile

Actions

Feature #8307

closed

Creating a pool with erasure code allows me to create invalid ec profile names.

Added by Pauline Middelink almost 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Monitor
Target version:
% Done:

100%

Source:
other
Tags:
Backport:
firefly
Reviewed:
Affected Versions:
Pull request ID:

Description

Lets much around with the cmdline

[root@storage ~]# ceph osd pool create ec 128 128 erasure erasure-code-k=9 erasure-code-m=1
Error EINVAL: cannot determine the erasure code plugin because there is no 'plugin' entry in the erasure_code_profile {}failed to load plugin using profile erasure-code-k=9

Fine. Expected an error, that webpage was old.

[root@storage ~]# ceph osd erasure-code-profile ls
default
erasure-code-k=9

Hmm. What's this? erasure-code-k=9 was created? Lets get rid of it.

[root@storage ~]# ceph osd erasure-code-profile rm erasure-code-k=9
Invalid command: invalid chars = in erasure-code-k=9
osd erasure-code-profile rm <name> : remove erasure code profile <name>
Error EINVAL: invalid command

[root@storage ~]# ceph osd erasure-code-profile rm "erasure-code-k=9"
Invalid command: invalid chars = in erasure-code-k=9
osd erasure-code-profile rm <name> : remove erasure code profile <name>
Error EINVAL: invalid command

Actions #1

Updated by Josh Durgin almost 10 years ago

  • Project changed from rbd to Ceph
  • Category set to Monitor
Actions #2

Updated by Ian Colle almost 10 years ago

  • Assignee set to Joao Eduardo Luis
Actions #3

Updated by Joao Eduardo Luis almost 10 years ago

  • Assignee changed from Joao Eduardo Luis to Loïc Dachary

OSDMonitor::get_erasure_code() is calling OSDMap::get_erasure_code_profile(), which according to gdb ends up hitting the non-const version of the function.

Given there's no guard on the function to make sure the element exists in the map, we end up modifying the in-memory osdmap:

map<string,string> &get_erasure_code_profile(const string &name) {
  return erasure_code_profiles[name]; // < that adds 'name' to the map with an empty value
}

Loic suggested I'd assign this to him and I am doing as such.

We should add a unit test to cover this case in the future.

Actions #4

Updated by Loïc Dachary almost 10 years ago

  • Status changed from New to In Progress
  • Assignee changed from Loïc Dachary to Joao Eduardo Luis
Actions #5

Updated by Loïc Dachary almost 10 years ago

  • Assignee changed from Joao Eduardo Luis to Loïc Dachary
Actions #6

Updated by Loïc Dachary almost 10 years ago

  • Status changed from In Progress to Fix Under Review
Actions #7

Updated by Loïc Dachary almost 10 years ago

  • Target version set to 0.83
  • % Done changed from 0 to 80
  • Backport set to firefly
Actions #8

Updated by Loïc Dachary almost 10 years ago

  • Status changed from Fix Under Review to Resolved
  • % Done changed from 80 to 100
Actions #9

Updated by Loïc Dachary almost 10 years ago

  • Status changed from Resolved to Pending Backport
  • % Done changed from 100 to 90
Actions #11

Updated by Loïc Dachary almost 10 years ago

  • Tracker changed from Bug to Feature
  • Target version changed from 0.83 to 0.82
Actions #12

Updated by Loïc Dachary almost 10 years ago

  • Status changed from Pending Backport to Fix Under Review
Actions #13

Updated by Ian Colle almost 10 years ago

  • Target version changed from 0.82 to 0.83 cont.
Actions #14

Updated by Loïc Dachary almost 10 years ago

  • Status changed from Fix Under Review to Resolved
  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF