X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_handler.c;h=c4116152291a096cfe0fd763ed7da88ee166cd18;hp=9ec7267f8a755e62c11c72c32b0eea4bfa0d2227;hb=999a8f1f0f9ab1a47843b4fa24ff88e5afd894b2;hpb=b243f9c5f447aaa446f11133b2c649e877678825;ds=sidebyside diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 9ec7267..c411615 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -984,10 +984,7 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info, 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); @@ -999,21 +996,27 @@ relock: 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);