In case of nonexistent file, calling Client::replication()
triggers assert.
Signed-off-by: Andrey Stepachev <octo@yandex-team.ru>
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
ceph_mount_info *cmount = get_ceph_mount_t(env, obj);
int fh = 0;
fh = ceph_open(cmount, c_path, O_RDONLY, 0);
+ env->ReleaseStringUTFChars(j_path, c_path);
+ if (fh < 0) {
+ return fh;
+ }
int replication = ceph_get_file_replication(cmount, fh);
ceph_close(cmount, fh);
- env->ReleaseStringUTFChars(j_path, c_path);
return replication;
}