struct thandle *handle)
{
struct dt_object *next = mdd_object_child(o);
- return next->do_ops->do_create(env, next, attr, hint, dof, handle);
+ struct md_ucred *uc = md_ucred(env);
+ __u32 saved;
+ int rc;
+
+ /*
+ * LU-974 enforce client umask in creation.
+ * TODO: CMD needs to handle this for remote object.
+ */
+ saved = xchg(¤t->fs->umask, uc->mu_umask & S_IRWXUGO);
+
+ rc = next->do_ops->do_create(env, next, attr, hint, dof, handle);
+
+ /* restore previous umask value */
+ current->fs->umask = saved;
+
+ return rc;
}
static inline