Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 6 additions & 5 deletions src/include/daos_srv/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ struct ds_obj_enum_arg {
int rnum; /* records num (type == S||R) */
daos_size_t rsize; /* record size (type == S||R) */
daos_unit_oid_t oid; /* for unpack */
uint32_t fill_recxs:1, /* type == S||R */
chk_key2big:1,
need_punch:1, /* need to pack punch epoch */
obj_punched:1, /* object punch is packed */
size_query:1; /* Only query size */
uint32_t fill_recxs : 1, /* type == S||R */
chk_key2big : 1, need_punch : 1, /* need to pack punch epoch */
obj_punched : 1, /* object punch is packed */
size_query : 1, /* Only query size */
rc_key2big : 1; /* [out] The requested key is too big. kds[0].kd_key_len contains the
minimal required buffer size. */
};

struct dtx_handle;
Expand Down
17 changes: 12 additions & 5 deletions src/object/srv_enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ fill_key(daos_handle_t ih, vos_iter_entry_t *key_ent, struct ds_obj_enum_arg *ar
(arg->chk_key2big && arg->kds_len <= 2)) {
if (arg->kds[0].kd_key_len < total_size)
arg->kds[0].kd_key_len = total_size;
return -DER_KEY2BIG;
} else {
return 1;
arg->rc_key2big = 1;
Comment thread
janekmi marked this conversation as resolved.
}

return 1;
}

iov = &arg->sgl->sg_iovs[arg->sgl_idx];
Expand Down Expand Up @@ -622,7 +622,7 @@ fill_rec(daos_handle_t ih, vos_iter_entry_t *key_ent, struct ds_obj_enum_arg *ar
(arg->kds_len < 3 || (arg->kds_len == 3 && !bump_kds_len))) {
if (arg->kds[0].kd_key_len < size)
arg->kds[0].kd_key_len = size;
D_GOTO(out, rc = -DER_KEY2BIG);
arg->rc_key2big = 1;
}
D_GOTO(out, rc = 1);
} else {
Expand Down Expand Up @@ -754,9 +754,16 @@ ds_obj_enum_pack(vos_iter_param_t *param, vos_iter_type_t type, bool recursive,
D_ASSERT(!arg->fill_recxs ||
type == VOS_ITER_SINGLE || type == VOS_ITER_RECX);

arg->rc_key2big = 0;

rc = iter_cb(param, type, recursive, anchors, enum_pack_cb, NULL,
arg, dth);

D_DEBUG(DB_IO, "enum type %d rc %d\n", type, rc);
D_DEBUG(DB_IO, "enum type %d rc %d rc_key2big %d\n", type, rc, arg->rc_key2big == 1);

if (arg->rc_key2big == 1) {
rc = -DER_KEY2BIG;
}

return rc;
}
Loading