Whamcloud - gitweb
Fix for truncate/write inversion.
authoradilger <adilger>
Fri, 15 Aug 2003 20:28:09 +0000 (20:28 +0000)
committeradilger <adilger>
Fri, 15 Aug 2003 20:28:09 +0000 (20:28 +0000)
b=1639
r=phil

lustre/llite/llite_lib.c

index e64c5da..791dfbc 100644 (file)
@@ -670,8 +670,12 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
                  * nodes through dirtying and writeback of final cached
                  * pages.  This last one is especially bad for racing
                  * o_append users on other nodes. */
+                /* bug 1639: avoid write/truncate i_sem/DLM deadlock */
+                LASSERT(atomic_read(&inode->i_sem.count) == 0);
+                up(&inode->i_sem);
                 rc = ll_extent_lock_no_validate(NULL, inode, lsm, LCK_PW,
                                                  &extent, &lockh);
+                down(&inode->i_sem);
                 if (rc != ELDLM_OK) {
                         if (rc > 0)
                                 RETURN(-ENOLCK);