int Client::get_osd_crush_location(int id, vector<pair<string, string> >& path)
{
Mutex::Locker lock(client_lock);
+ if (id < 0)
+ return -EINVAL;
return osdmap->crush->get_full_location_ordered(id, path);
}
char path[256];
ASSERT_EQ(ceph_get_osd_crush_location(cmount, 9999999, path, 0), -ENOENT);
- ASSERT_EQ(ceph_get_osd_crush_location(cmount, -1, path, 0), -ENOENT);
+ ASSERT_EQ(ceph_get_osd_crush_location(cmount, -1, path, 0), -EINVAL);
char test_file[256];
sprintf(test_file, "test_osds_loc_%d", getpid());