Whamcloud - gitweb
- fixes with locking. Now mkdir causes client cache flush and thus client always...
authoryury <yury>
Fri, 28 Jul 2006 08:20:30 +0000 (08:20 +0000)
committeryury <yury>
Fri, 28 Jul 2006 08:20:30 +0000 (08:20 +0000)
lustre/llite/file.c
lustre/mdt/mdt_reint.c

index 17cdda2..44a82af 100644 (file)
@@ -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);
index 3d8e117..917f4f5 100644 (file)
@@ -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);