const char *update_op_str(__u16 opc)
{
- static const char *opc_str[] = {
+ static const char *const opc_str[] = {
[OUT_START] = "start",
[OUT_CREATE] = "create",
[OUT_DESTROY] = "destroy",
if (ta->ta_alloc_args >= new_alloc_ta)
return 0;
- OBD_ALLOC(new_ta, sizeof(*new_ta) * new_alloc_ta);
+ OBD_ALLOC_PTR_ARRAY(new_ta, new_alloc_ta);
if (new_ta == NULL)
return -ENOMEM;
/* free the old args */
if (ta->ta_args != NULL)
- OBD_FREE(ta->ta_args, sizeof(ta->ta_args[0]) *
- ta->ta_alloc_args);
+ OBD_FREE_PTR_ARRAY(ta->ta_args, ta->ta_alloc_args);
ta->ta_args = new_ta;
ta->ta_alloc_args = new_alloc_ta;
if (new_ta[i] != NULL)
OBD_FREE_PTR(new_ta[i]);
}
- OBD_FREE(new_ta, sizeof(*new_ta) * new_alloc_ta);
+ OBD_FREE_PTR_ARRAY(new_ta, new_alloc_ta);
}
return rc;
}
struct tx_arg *arg;
int rc;
+ /* LU-13653: ignore quota for DNE directory creation */
+ if (dof->dof_type == DFT_DIR)
+ th->th_ignore_quota = 1;
+
rc = dt_declare_create(env, obj, attr, NULL, dof, th);
if (rc != 0)
return rc;
if (arg->reply != NULL)
object_update_result_insert(arg->reply, NULL, 0, arg->index,
- rc);
+ rc < 0 ? rc : 0);
return rc > 0 ? 0 : rc;
}
dt_obd_name(th->th_dev), arg->u.xattr_set.buf.lb_buf,
arg->u.xattr_set.name, arg->u.xattr_set.flags);
- if (!lu_object_exists(&dt_obj->do_lu)) {
+ if (!lu_object_exists(&dt_obj->do_lu) ||
+ OBD_FAIL_PRECHECK(OBD_FAIL_OUT_OBJECT_MISS)) {
rc = -ENOENT;
} else {
struct linkea_data ldata = { 0 };