if (!cmount->is_mounted())
return -ENOTCONN;
- if (!path)
+ if (!path && len)
return -EINVAL;
vector<pair<string, string> > loc;
string& type = it->first;
string& name = it->second;
needed += type.size() + name.size() + 2;
- if (needed < len) {
+ if (needed <= len) {
strcpy(path + cur, type.c_str());
cur += type.size() + 1;
strcpy(path + cur, name.c_str());
ASSERT_EQ(ceph_conf_read_file(cmount, NULL), 0);
ASSERT_EQ(ceph_mount(cmount, NULL), 0);
- ASSERT_EQ(ceph_get_osd_crush_location(cmount, 0, NULL, 0), -EINVAL);
+ ASSERT_EQ(ceph_get_osd_crush_location(cmount, 0, NULL, 1), -EINVAL);
char path[256];
ASSERT_EQ(ceph_get_osd_crush_location(cmount, 9999999, path, 0), -ENOENT);