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.
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
- Project changed from rbd to Ceph
- Category set to Monitor
- Assignee set to Joao Eduardo Luis
- 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.
- Status changed from New to In Progress
- Assignee changed from Loïc Dachary to Joao Eduardo Luis
- Assignee changed from Joao Eduardo Luis to Loïc Dachary
- Status changed from In Progress to Fix Under Review
- Target version set to 0.83
- % Done changed from 0 to 80
- Backport set to firefly
- Status changed from Fix Under Review to Resolved
- % Done changed from 80 to 100
- Status changed from Resolved to Pending Backport
- % Done changed from 100 to 90
- Tracker changed from Bug to Feature
- Target version changed from 0.83 to 0.82
- Status changed from Pending Backport to Fix Under Review
- Target version changed from 0.82 to 0.83 cont.
- Status changed from Fix Under Review to Resolved
- % Done changed from 90 to 100
Also available in: Atom
PDF