diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index 22a929d..b133956 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -427,9 +427,6 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, ll_frob_intent(&it, &lookup_it); LASSERT(it); - if (it->it_op == IT_LOOKUP && !(de->d_flags & DCACHE_LUSTRE_INVALID)) - GOTO(out_sa, rc = 1); - ll_prepare_mdc_op_data(&op_data, parent, de->d_inode, de->d_name.name, de->d_name.len, 0, NULL); diff --git a/lustre/mds/mds_xattr.c b/lustre/mds/mds_xattr.c index cd84bc5..421d31b 100644 --- a/lustre/mds/mds_xattr.c +++ b/lustre/mds/mds_xattr.c @@ -234,6 +234,7 @@ int mds_setxattr_internal(struct ptlrpc_request *req, struct mds_body *body) int xattrlen; int rc = -EOPNOTSUPP, err = 0, sync = 0; __u64 lockpart; + int lockmode; ENTRY; LASSERT(body); @@ -243,8 +244,6 @@ int mds_setxattr_internal(struct ptlrpc_request *req, struct mds_body *body) MDS_CHECK_RESENT(req, mds_reconstruct_generic(req)); - lockpart = MDS_INODELOCK_UPDATE; - /* various sanity check for xattr name */ xattr_name = lustre_msg_string(req->rq_reqmsg, REQ_REC_OFF + 1, 0); if (!xattr_name) { @@ -278,11 +277,17 @@ int mds_setxattr_internal(struct ptlrpc_request *req, struct mds_body *body) GOTO(out, -ERANGE); } - - if (!strcmp(xattr_name, XATTR_NAME_ACL_ACCESS)) + lockpart = MDS_INODELOCK_UPDATE; + if (!strcmp(xattr_name, XATTR_NAME_ACL_ACCESS)) { lockpart |= MDS_INODELOCK_LOOKUP; + lockmode = LCK_EX; + } else { + /* we don't need cancel a getattr lock until client will + * cache whole xattr buffer */ + lockmode = LCK_PW; + } - de = mds_fid2locked_dentry(obd, &body->fid1, NULL, LCK_EX, + de = mds_fid2locked_dentry(obd, &body->fid1, NULL, lockmode, &lockh, NULL, 0, lockpart); if (IS_ERR(de)) GOTO(out, rc = PTR_ERR(de));