struct mdt_reint_record *rr = &info->mti_rr;
struct md_attr *ma = &info->mti_attr;
struct lu_attr *attr = &info->mti_attr.ma_attr;
- struct mdt_object *obj;
+ struct mdt_object *obj;
struct md_object *child;
__u64 valid = attr->la_valid;
const char *xattr_name;
GOTO(out, rc = 0);
} else if ((valid & OBD_MD_FLXATTR) &&
(strncmp(xattr_name, XATTR_NAME_ACL_ACCESS,
- sizeof(XATTR_NAME_ACL_ACCESS) - 1) == 0)) {
+ sizeof(XATTR_NAME_ACL_ACCESS) - 1) == 0 ||
+ strncmp(xattr_name, XATTR_NAME_ACL_DEFAULT,
+ sizeof(XATTR_NAME_ACL_DEFAULT) - 1) == 0)) {
/* currently lustre limit acl access size */
xattr_len = req_capsule_get_size(pill, &RMF_EADATA, RCL_CLIENT);
}
lockpart = MDS_INODELOCK_UPDATE;
+ /* Revoke all clients' lookup lock, since the access
+ * permissions for this inode is changed when ACL_ACCESS is
+ * set. This isn't needed for ACL_DEFAULT, since that does
+ * not change the access permissions of this inode, nor any
+ * other existing inodes. It is setting the ACLs inherited
+ * by new directories/files at create time. */
if (!strcmp(xattr_name, XATTR_NAME_ACL_ACCESS))
lockpart |= MDS_INODELOCK_LOOKUP;
lh = &info->mti_lh[MDT_LH_PARENT];
- mdt_lock_reg_init(lh, LCK_PW);
+ /* ACLs were sent to clients under LCK_CR locks, so taking LCK_EX
+ * to cancel them. */
+ mdt_lock_reg_init(lh, LCK_EX);
obj = mdt_object_find_lock(info, rr->rr_fid1, lh, lockpart);
if (IS_ERR(obj))
GOTO(out, rc = PTR_ERR(obj));
GOTO(out_unlock, rc);
if (unlikely(!(valid & OBD_MD_FLCTIME))) {
- CWARN("client miss to set OBD_MD_FLCTIME when "
- "setxattr: [object "DFID"] [valid "LPU64"]\n",
+ /* This isn't strictly an error, but all current clients
+ * should set OBD_MD_FLCTIME when setting attributes. */
+ CWARN("%s: client miss to set OBD_MD_FLCTIME when "
+ "setxattr %s: [object "DFID"] [valid "LPU64"]\n",
+ info->mti_exp->exp_obd->obd_name, xattr_name,
PFID(rr->rr_fid1), valid);
attr->la_ctime = cfs_time_current_sec();
}