+ char *tmp_name = info->mti_key;
+
+ if (lname.ln_namelen >= sizeof(info->mti_key)) {
+ /* lnamelen is too big(> NAME_MAX + 16),
+ * something wrong about this linkea, let's
+ * skip it */
+ linkea_del_buf(ldata, &lname);
+ mdd_object_put(env, pobj);
+ goto again;
+ }
+
+ /* Note: lname might be without \0 at the end, see
+ * linkea_entry_unpack(), let's add extra \0 by
+ * snprintf */
+ snprintf(tmp_name, sizeof(info->mti_key), "%.*s",
+ lname.ln_namelen, lname.ln_name);
+ lname.ln_name = tmp_name;
+
+ /* Let's check if this linkEA still valid, before
+ * it might be packed into the RPC buffer. */
+ rc = mdd_lookup(env, &pobj->mod_obj, &lname,
+ &info->mti_fid, NULL);
+ if (rc < 0 ||
+ !lu_fid_eq(&info->mti_fid,
+ mdd_object_fid(mdd_sobj))) {
+ /* skip invalid linkea entry */
+ linkea_del_buf(ldata, &lname);
+ mdd_object_put(env, pobj);
+ goto again;
+ }
+
+ rc = __mdd_index_delete(env, pobj, tmp_name, 0, handle);
+ if (rc != 0)