switch (cattr->la_mode & S_IFMT) {
case S_IFLNK: {
- unsigned int symlen = strlen(spec->u.sp_symname) + 1;
+ unsigned int symlen = spec->u.sp_symname.ln_namelen + 1;
if (symlen > m->mdd_dt_conf.ddp_symlink_max)
RETURN(-ENAMETOOLONG);
}
if (S_ISLNK(attr->la_mode)) {
- const char *target_name = spec->u.sp_symname;
- int sym_len = strlen(target_name);
+ const char *target_name = spec->u.sp_symname.ln_name;
+ int sym_len = spec->u.sp_symname.ln_namelen;
const struct lu_buf *buf;
buf = mdd_buf_get_const(env, target_name, sym_len);
if (S_ISLNK(attr->la_mode)) {
struct dt_object *dt = mdd_object_child(son);
- const char *target_name = spec->u.sp_symname;
- int sym_len = strlen(target_name);
+ const char *target_name = spec->u.sp_symname.ln_name;
+ int sym_len = spec->u.sp_symname.ln_namelen;
loff_t pos = 0;
buf = mdd_buf_get_const(env, target_name, sym_len);
lum->lum_hash_type |= cpu_to_le32(LMV_HASH_FLAG_MIGRATION);
} else if (S_ISLNK(attr->la_mode)) {
- spec->u.sp_symname = sbuf->lb_buf;
+ spec->u.sp_symname.ln_name = sbuf->lb_buf;
+ /* don't count NUL */
+ spec->u.sp_symname.ln_namelen = sbuf->lb_len - 1;
} else if (S_ISREG(attr->la_mode)) {
spec->sp_cr_flags |= MDS_OPEN_DELAY_CREATE;
spec->sp_cr_flags &= ~MDS_OPEN_HAS_EA;