LASSERT(obj != NULL);
LASSERT(lu_object_assert_exists(&obj->mot_obj));
+ /* Unlike intent case where we need to pre-fill out buffers early on
+ * in intent policy for ldlm reasons, here we can have a much better
+ * guess at EA size by just reading it from disk.
+ * Exceptions are readdir and (missing) directory striping */
/* Readlink */
if (reqbody->valid & OBD_MD_LINKNAME) {
/* No easy way to know how long is the symlink, but it cannot
* will reallocate */
rc = DEF_REP_MD_SIZE;
} else {
- /* Hopefully no race in EA change for either file or directory?
- */
+ /* Read the actual EA size from disk */
rc = mdt_attr_get_eabuf_size(info, obj);
}
if (rc < 0)
GOTO(out_shrink, rc);
- /* old clients may not report needed easize, use max value then */
req_capsule_set_size(pill, &RMF_MDT_MD, RCL_SERVER, rc);
rc = req_capsule_server_pack(pill);
if (ss == NULL)
return;
- if (ss->ss_server_seq == NULL)
+ if (ss->ss_server_seq != NULL)
seq_server_set_cli(NULL, ss->ss_server_seq, NULL);
-
- return;
}
static int mdt_seq_fini(const struct lu_env *env, struct mdt_device *mdt)