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

Commit f8f1c23

Browse files
rgw_sal_motr: [CORTX-33766] Fix for CopyObject API for zero byte object.
Problem: CopyObject operation fails for zero byte object with 'NoSuchKey' error. Solution: Read/write to Motr only if object size is greater than zero. Signed-off-by: Shriya Deshmukh <[email protected]>
1 parent 13b051f commit f8f1c23

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/rgw/rgw_sal_motr.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,11 +2420,14 @@ int MotrObject::copy_object_same_zone(RGWObjectCtx& obj_ctx,
24202420
return rc;
24212421
}
24222422

2423-
// read::iterate -> handle_data() -> write::process
2424-
rc = read_op->iterate(dpp, cur_ofs, cur_end, filter, y);
2425-
if (rc < 0){
2426-
ldpp_dout(dpp, 20) << "ERROR: read op iterate failed rc=" << rc << dendl;
2427-
return rc;
2423+
// read from/write to motr, if source object is non empty object.
2424+
if (obj_size > 0){
2425+
// read::iterate -> handle_data() -> write::process
2426+
rc = read_op->iterate(dpp, cur_ofs, cur_end, filter, y);
2427+
if (rc < 0){
2428+
ldpp_dout(dpp, 20) << "ERROR: read op iterate failed rc=" << rc << dendl;
2429+
return rc;
2430+
}
24282431
}
24292432

24302433
real_time time = ceph::real_clock::now();

0 commit comments

Comments
 (0)