static int fld_server_handle(struct lu_server_fld *fld,
const struct lu_context *ctx,
- __u32 opc, struct md_fld *mf)
+ __u32 opc, struct md_fld *mf,
+ struct fld_thread_info *info)
{
int rc;
ENTRY;
case FLD_CREATE:
rc = fld_server_create(fld, ctx,
mf->mf_seq, mf->mf_mds);
+
+ /* do not return -EEXIST error for resent case */
+ if ((info->fti_flags & FLD_MSG_RESENT) && rc == -EEXIST)
+ rc = 0;
break;
case FLD_DELETE:
rc = fld_server_delete(fld, ctx, mf->mf_seq);
+
+ /* do not return -ENOENT error for resent case */
+ if ((info->fti_flags & FLD_MSG_RESENT) && rc == -ENOENT)
+ rc = 0;
break;
case FLD_LOOKUP:
rc = fld_server_lookup(fld, ctx,
if (out == NULL)
RETURN(-EPROTO);
*out = *in;
+
+ if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY)
+ info->fti_flags |= FLD_MSG_REPLAY;
+
+ if (lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT)
+ info->fti_flags |= FLD_MSG_RESENT;
+
rc = fld_server_handle(site->ls_server_fld,
req->rq_svc_thread->t_ctx,
- *opc, out);
+ *opc, out, info);
}
RETURN(rc);
{
int i;
+ info->fti_flags = 0;
+
/* mark rep buffer as req-layout stuff expects */
for (i = 0; i < ARRAY_SIZE(info->fti_rep_buf_size); i++)
info->fti_rep_buf_size[i] = -1;
extern struct lu_fld_hash fld_hash[];
+enum {
+ FLD_MSG_RESENT = 1 << 0,
+ FLD_MSG_REPLAY = 1 << 1
+};
+
#ifdef __KERNEL__
struct fld_thread_info {
struct req_capsule fti_pill;
int fti_rep_buf_size[REQ_MAX_FIELD_NR];
__u64 fti_key;
__u64 fti_rec;
+ __u32 fti_flags;
};
int fld_index_init(struct lu_server_fld *fld,