#define MDT_CONNECT_SUPPORTED (OBD_CONNECT_RDONLY | OBD_CONNECT_VERSION | \
OBD_CONNECT_ACL | OBD_CONNECT_XATTR | \
OBD_CONNECT_IBITS | OBD_CONNECT_JOIN | \
- OBD_CONNECT_NODEVOH |/* OBD_CONNECT_ATTRFID |*/\
+ OBD_CONNECT_NODEVOH | OBD_CONNECT_ATTRFID | \
OBD_CONNECT_CANCELSET | OBD_CONNECT_AT | \
OBD_CONNECT_RMT_CLIENT | \
OBD_CONNECT_RMT_CLIENT_FORCE | \
exp = ll_i2mdexp(inode);
+ /* XXX: Enable OBD_CONNECT_ATTRFID to reduce unnecessary getattr RPC.
+ * But under CMD case, it caused some lock issues, should be fixed
+ * with new CMD ibits lock. See bug 12718 */
if (exp->exp_connect_flags & OBD_CONNECT_ATTRFID) {
struct lookup_intent oit = { .it_op = IT_GETATTR };
struct md_op_data *op_data;
LDLM_LOCK_PUT(lock);
rc = 0;
} else {
- struct md_attr *ma;
relock:
- ma = &info->mti_attr;
-
OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_RESEND, obd_timeout*2);
mdt_lock_handle_init(lhc);
mdt_lock_reg_init(lhc, LCK_PR);
GOTO(out_child, rc = -ESTALE);
}
- ma->ma_valid = 0;
- ma->ma_need = MA_INODE;
- rc = mo_attr_get(info->mti_env, next, ma);
- if (unlikely(rc != 0))
- GOTO(out_child, rc);
+ if (!(child_bits & MDS_INODELOCK_UPDATE)) {
+ struct md_attr *ma = &info->mti_attr;
- /* If the file has not been changed for some time, we return
- * not only a LOOKUP lock, but also an UPDATE lock and this
- * might save us RPC on later STAT. For directories, it also
- * let negative dentry starts working for this dir. */
- if (ma->ma_valid & MA_INODE &&
- ma->ma_attr.la_valid & LA_CTIME &&
- info->mti_mdt->mdt_namespace->ns_ctime_age_limit +
- ma->ma_attr.la_ctime < cfs_time_current_sec())
- child_bits |= MDS_INODELOCK_UPDATE;
+ ma->ma_valid = 0;
+ ma->ma_need = MA_INODE;
+ rc = mo_attr_get(info->mti_env,
+ mdt_object_child(child), ma);
+ if (unlikely(rc != 0))
+ GOTO(out_child, rc);
+
+ /* If the file has not been changed for some time, we
+ * return not only a LOOKUP lock, but also an UPDATE
+ * lock and this might save us RPC on later STAT. For
+ * directories, it also let negative dentry starts
+ * working for this dir. */
+ if (ma->ma_valid & MA_INODE &&
+ ma->ma_attr.la_valid & LA_CTIME &&
+ info->mti_mdt->mdt_namespace->ns_ctime_age_limit +
+ ma->ma_attr.la_ctime < cfs_time_current_sec())
+ child_bits |= MDS_INODELOCK_UPDATE;
+ }
rc = mdt_object_lock(info, child, lhc, child_bits,
MDT_CROSS_LOCK);