*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*
* lustre/mdd/mdd_dir.c
*
static int
__mdd_lookup(const struct lu_env *env, struct md_object *pobj,
const struct lu_attr *pattr, const struct lu_name *lname,
- struct lu_fid* fid, int mask)
+ struct lu_fid *fid, unsigned int may_mask)
{
const char *name = lname->ln_name;
const struct dt_key *key = (const struct dt_key *)name;
PFID(mdd_object_fid(mdd_obj)));
}
- rc = mdd_permission_internal_locked(env, mdd_obj, pattr, mask,
+ rc = mdd_permission_internal_locked(env, mdd_obj, pattr, may_mask,
DT_TGT_PARENT);
if (rc)
RETURN(rc);
/* Enough for only unlink the entry */
if (unlikely(mdd_cobj == NULL))
- GOTO(stop, rc);
+ GOTO(cleanup, rc);
if (cattr->la_nlink > 0 || mdd_cobj->mod_count > 0) {
/* update ctime of an unlinked file only if it is still
const struct lu_buf *buf;
int rc;
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
+ /* ldiskfs OSD needs this information for credit allocation */
+ if (def_acl_buf)
+ hint->dah_acl_len = def_acl_buf->lb_len;
+#endif
rc = mdd_declare_create_object_internal(env, p, c, attr, handle, spec,
hint);
if (rc)
XATTR_NAME_ACL_DEFAULT);
mdd_read_unlock(env, pobj);
if (rc > 0) {
+ /* ACL buffer size is not enough, need realloc */
+ if (rc > acl_buf->lb_len)
+ RETURN(-ERANGE);
+
/* If there are default ACL, fix mode/ACL by default ACL */
def_acl_buf->lb_len = rc;
- LASSERT(def_acl_buf->lb_len <= acl_buf->lb_len);
memcpy(acl_buf->lb_buf, def_acl_buf->lb_buf, rc);
acl_buf->lb_len = rc;
rc = __mdd_fix_mode_acl(env, acl_buf, &la->la_mode);
{
__u32 lum_stripe_count = lum->lum_stripe_count;
__u32 lmv_hash_type = lmv->lmv_hash_type;
- char *mdt_hash_name[] = { "none",
- LMV_HASH_NAME_ALL_CHARS,
- LMV_HASH_NAME_FNV_1A_64,
- LMV_HASH_NAME_CRUSH,
- };
if (!lmv_is_sane(lmv))
return -EBADF;