Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Handle error from m0_layout_find_by_objsz() #254

Merged
merged 1 commit into from
Jun 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/rgw/rgw_sal_motr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,10 @@ int MotrObject::create_mobj(const DoutPrefixProvider *dpp, uint64_t sz)
ldpp_dout(dpp, 20) <<__func__<< ": sz=" << sz << " oid=" << fid_str << dendl;

int64_t lid = m0_layout_find_by_objsz(store->instance, nullptr, sz);
M0_ASSERT(lid > 0);
if (lid <= 0) {
ldpp_dout(dpp, 0) <<__func__<< ": failed to get lid: " << lid << dendl;
return lid == 0 ? -EINVAL : (int)lid;
}

M0_ASSERT(mobj == nullptr);
mobj = new m0_obj();
Expand Down