Feature #8307
closedCreating a pool with erasure code allows me to create invalid ec profile names.
100%
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
Updated by Josh Durgin almost 10 years ago
- Project changed from rbd to Ceph
- Category set to Monitor
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.
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
Updated by Loïc Dachary almost 10 years ago
- Assignee changed from Joao Eduardo Luis to Loïc Dachary
Updated by Loïc Dachary almost 10 years ago
- Status changed from In Progress to Fix Under Review
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
Updated by Loïc Dachary almost 10 years ago
- Status changed from Fix Under Review to Resolved
- % Done changed from 80 to 100
Updated by Loïc Dachary almost 10 years ago
- Status changed from Resolved to Pending Backport
- % Done changed from 100 to 90
Updated by Loïc Dachary almost 10 years ago
- Tracker changed from Bug to Feature
- Target version changed from 0.83 to 0.82
Updated by Loïc Dachary almost 10 years ago
- Status changed from Pending Backport to Fix Under Review
Updated by Ian Colle almost 10 years ago
- Target version changed from 0.82 to 0.83 cont.
Updated by Loïc Dachary almost 10 years ago
- Status changed from Fix Under Review to Resolved
- % Done changed from 90 to 100