Whamcloud - gitweb
b=11063 fix lock inversion
authorVladimir Saveliev <Vladimir.Saveliev@Sun.COM>
Wed, 9 Jun 2010 12:55:27 +0000 (16:55 +0400)
committerJohann Lombardi <johann@sun.com>
Wed, 9 Jun 2010 21:38:27 +0000 (23:38 +0200)
unlock inode mutex before extent lock acquisition to avoid lock order inversion
few misspells are fixed

i=green
i=vitaly

lustre/liblustre/llite_lib.h
lustre/liblustre/rw.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c

index a40098a..b076c45 100644 (file)
@@ -107,7 +107,7 @@ struct llu_inode_info {
         /* not for stat, change it later */
         int                     lli_st_flags;
         unsigned long           lli_st_generation;
-        /* the most recent attributes from mds, it is used for timestampts
+        /* the most recent attributes from mds, it is used for timestamps
          * only so far */
         struct ost_lvb         lli_lvb;
 };
index a6af277..2983452 100644 (file)
@@ -274,7 +274,7 @@ int llu_glimpse_size(struct inode *inode)
 
         lov_stripe_lock(lli->lli_smd);
         inode_init_lvb(inode, &lvb);
-        /* merge timestamps the most resently obtained from mds with
+        /* merge timestamps the most recently obtained from mds with
            timestamps obtained from osts */
         lvb = lli->lli_lvb;
         rc = obd_merge_lvb(sbi->ll_osc_exp, lli->lli_smd, &lvb, 0);
index c007815..16f0209 100644 (file)
@@ -998,7 +998,7 @@ int ll_glimpse_size(struct inode *inode, int ast_flags)
 
         ll_inode_size_lock(inode, 1);
         inode_init_lvb(inode, &lvb);
-        /* merge timestamps the most resently obtained from mds with
+        /* merge timestamps the most recently obtained from mds with
            timestamps obtained from osts */
         lvb.lvb_atime = lli->lli_lvb.lvb_atime;
         lvb.lvb_mtime = lli->lli_lvb.lvb_mtime;
index 6c79825..0b11fe7 100644 (file)
@@ -185,7 +185,7 @@ struct ll_inode_info {
         void                   *lli_opendir_key;
         struct ll_statahead_info *lli_sai;
         struct rw_semaphore     lli_truncate_rwsem;
-        /* the most recent attributes from mds, it is used for timestampts
+        /* the most recent attributes from mds, it is used for timestamps
          * only so far */
         struct ost_lvb         lli_lvb;
         struct inode            lli_vfs_inode;
index 59a8140..46d09aa 100644 (file)
@@ -1545,6 +1545,7 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
                         if (LTIME_S(attr->ia_mtime) < LTIME_S(attr->ia_ctime)){
                                 struct ost_lvb xtimes;
 
+                                UNLOCK_INODE_MUTEX(inode);
                                 /* setting mtime to past is performed under PW
                                  * EOF extent lock */
                                 oinfo->oi_policy.l_extent.start = 0;
@@ -1552,6 +1553,7 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
                                 rc = ll_extent_lock(NULL, inode, lsm, LCK_PW,
                                                     &oinfo->oi_policy,
                                                     &lockh, 0);
+                                LOCK_INODE_MUTEX(inode);
                                 if (rc) {
                                         OBD_FREE_PTR(oinfo);
                                         RETURN(rc);