If the detection of the old format fails with reasons other than
-ENOENT, we should return with this error. Otherwise, if we continue the
new format detection and fail with -ENOENT, the caller will get the
missleading failure information.
Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
if (old_format)
*old_format = true;
int r = io_ctx.stat(old_header_name(name), size, NULL);
- if (r < 0) {
+ if (r == -ENOENT) {
if (old_format)
*old_format = false;
r = io_ctx.stat(id_obj_name(name), size, NULL);
if (r < 0)
return r;
+ } else if (r < 0) {
+ return r;
}
ldout(cct, 20) << "detect format of " << name << " : "