From: yury Date: Fri, 28 Jul 2006 08:20:30 +0000 (+0000) Subject: - fixes with locking. Now mkdir causes client cache flush and thus client always... X-Git-Tag: v1_8_0_110~486^2~1324 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=aa624df6e219732fc96b60755a4451839794cb8e;p=fs%2Flustre-release.git - fixes with locking. Now mkdir causes client cache flush and thus client always see valid directory content. --- diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 17cdda2..44a82af 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -283,6 +283,8 @@ int ll_file_open(struct inode *inode, struct file *file) RETURN(-ENOMEM); if (!it || !it->d.lustre.it_disposition) { + struct ll_sb_info *sbi = ll_i2sbi(inode); + /* Convert f_flags into access mode. We cannot use file->f_mode, * because everything but O_ACCMODE mask was stripped from * there */ @@ -304,6 +306,9 @@ int ll_file_open(struct inode *inode, struct file *file) ll_file_data_put(fd); GOTO(out, rc); } + + md_set_lock_data(sbi->ll_md_exp, &it->d.lustre.it_lock_handle, + file->f_dentry->d_inode); } lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_OPEN); diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 3d8e117..917f4f5 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -52,7 +52,7 @@ static int mdt_md_create(struct mdt_thread_info *info) repbody = req_capsule_server_get(&info->mti_pill, &RMF_MDT_BODY); lh = &info->mti_lh[MDT_LH_PARENT]; - lh->mlh_mode = LCK_PW; + lh->mlh_mode = LCK_EX; parent = mdt_object_find_lock(info, rr->rr_fid1, lh, MDS_INODELOCK_UPDATE);