Whamcloud - gitweb
LU-8446 llite: clear inode timestamps after losing UPDATE lock 23/22623/3
authorNiu Yawei <yawei.niu@intel.com>
Tue, 20 Sep 2016 07:50:42 +0000 (03:50 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 29 Sep 2016 14:59:07 +0000 (14:59 +0000)
Otherwise, those leftovers would interfere with new timestamps
especially when the timestamps are set back in time on the other
clients.

Test-Parameters: alwaysuploadlogs mdtfilesystemtype=ldiskfs mdsfilesystemtype=ldiskfs ostfilesystemtype=ldiskfs mdtcount=1 testlist=metadata-updates,metadata-updates
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: If4d385c82b2035c08276b9dd5cd8edd029a8c027
Reviewed-on: http://review.whamcloud.com/22623
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/namei.c

index 806d7a1..a8f961d 100644 (file)
@@ -273,6 +273,16 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
                                       PFID(ll_inode2fid(inode)), rc);
                }
 
+               if (bits & MDS_INODELOCK_UPDATE) {
+                       struct ll_inode_info *lli = ll_i2info(inode);
+
+                       spin_lock(&lli->lli_lock);
+                       LTIME_S(inode->i_mtime) = 0;
+                       LTIME_S(inode->i_atime) = 0;
+                       LTIME_S(inode->i_ctime) = 0;
+                       spin_unlock(&lli->lli_lock);
+               }
+
                if ((bits & MDS_INODELOCK_UPDATE) && S_ISDIR(inode->i_mode)) {
                        struct ll_inode_info *lli = ll_i2info(inode);