Whamcloud - gitweb
b=5492
authorphil <phil>
Sat, 5 Feb 2005 06:34:04 +0000 (06:34 +0000)
committerphil <phil>
Sat, 5 Feb 2005 06:34:04 +0000 (06:34 +0000)
Back out the KMS locking change; I saw a problem with it yesterday, and the
new truncate buffalo failures confirmed my suspicion.

lustre/ChangeLog
lustre/include/linux/lustre_lite.h
lustre/liblustre/rw.c
lustre/llite/file.c
lustre/llite/rw.c
lustre/llite/rw24.c

index ee1de1d..0fec309 100644 (file)
@@ -17,7 +17,6 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - use "int" for stripe value returned from lock_to_stripe (5544)
        - mballoc allocation and error-checking fixes in 2.6 (5504)
        - block device patches to fix I/O request sizes in 2.6 (5482)
-       - protect KMS changes with its own lock, not i_sem (5492, 5624, 3453)
        - look up hostnames for IB nals (5602)
        - 2.6 changed lock ordering of 2 semaphores, caused deadlock (5654)
        * miscellania
index 58b1053..b2adffd 100644 (file)
@@ -76,7 +76,7 @@ struct ll_inode_info {
         __u64                   lli_io_epoch;
         unsigned long           lli_flags;
 
-        /* this lock protects s_d_w, p_w_ll, and the KMS */
+        /* this lock protects s_d_w and p_w_ll */
         spinlock_t              lli_lock;
         int                     lli_send_done_writing;
         struct list_head        lli_pending_write_llaps;
index b1ec827..a59dba0 100644 (file)
@@ -113,15 +113,13 @@ static int llu_extent_lock_callback(struct ldlm_lock *lock,
 
                 stripe = llu_lock_to_stripe_offset(inode, lock);
                 l_lock(&lock->l_resource->lr_namespace->ns_lock);
-
                 kms = ldlm_extent_shift_kms(lock,
                                             lsm->lsm_oinfo[stripe].loi_kms);
+                l_unlock(&lock->l_resource->lr_namespace->ns_lock);
                 if (lsm->lsm_oinfo[stripe].loi_kms != kms)
                         LDLM_DEBUG(lock, "updating kms from "LPU64" to "LPU64,
                                    lsm->lsm_oinfo[stripe].loi_kms, kms);
                 lsm->lsm_oinfo[stripe].loi_kms = kms;
-
-                l_unlock(&lock->l_resource->lr_namespace->ns_lock);
 iput:
                 I_RELE(inode);
                 break;
index f438313..daf9669 100644 (file)
@@ -496,18 +496,17 @@ static int ll_extent_lock_callback(struct ldlm_lock *lock,
                  * lock hold times should be very short as ast processing
                  * requires them and has a short timeout.  so, i_sem before ns
                  * lock.*/
+                down(&inode->i_sem);
                 l_lock(&lock->l_resource->lr_namespace->ns_lock);
-                spin_lock(&lli->lli_lock);
-
                 kms = ldlm_extent_shift_kms(lock,
                                             lsm->lsm_oinfo[stripe].loi_kms);
+
                 if (lsm->lsm_oinfo[stripe].loi_kms != kms)
                         LDLM_DEBUG(lock, "updating kms from "LPU64" to "LPU64,
                                    lsm->lsm_oinfo[stripe].loi_kms, kms);
                 lsm->lsm_oinfo[stripe].loi_kms = kms;
-
-                spin_unlock(&lli->lli_lock);
                 l_unlock(&lock->l_resource->lr_namespace->ns_lock);
+                up(&inode->i_sem);
                 //ll_try_done_writing(inode);
         iput:
                 iput(inode);
@@ -554,16 +553,14 @@ int ll_async_completion_ast(struct ldlm_lock *lock, int flags, void *data)
                 lsm->lsm_oinfo[stripe].loi_rss = lvb->lvb_size;
 
                 l_lock(&lock->l_resource->lr_namespace->ns_lock);
-                spin_lock(&lli->lli_lock);
-
+                down(&inode->i_sem);
                 kms = MAX(lsm->lsm_oinfo[stripe].loi_kms, lvb->lvb_size);
                 kms = ldlm_extent_shift_kms(NULL, kms);
                 if (lsm->lsm_oinfo[stripe].loi_kms != kms)
                         LDLM_DEBUG(lock, "updating kms from "LPU64" to "LPU64,
                                    lsm->lsm_oinfo[stripe].loi_kms, kms);
                 lsm->lsm_oinfo[stripe].loi_kms = kms;
-
-                spin_unlock(&lli->lli_lock);
+                up(&inode->i_sem);
                 l_unlock(&lock->l_resource->lr_namespace->ns_lock);
         }
 
index 490b0b1..6b68ea5 100644 (file)
@@ -642,9 +642,7 @@ int ll_commit_write(struct file *file, struct page *page, unsigned from,
 out:
         size = (((obd_off)page->index) << PAGE_SHIFT) + to;
         if (rc == 0) {
-                spin_lock(&lli->lli_lock);
                 obd_increase_kms(exp, lsm, size);
-                spin_unlock(&lli->lli_lock);
                 if (size > inode->i_size)
                         inode->i_size = size;
                 SetPageUptodate(page);
index e291d64..6ad6dcd 100644 (file)
@@ -176,11 +176,8 @@ static int ll_direct_IO_24(int rw,
         ptlrpc_set_destroy(set);
         if (rc == 0) {
                 rc = iobuf->length;
-                if (rw == WRITE) {
-                        spin_lock(&lli->lli_lock);
+                if (rw == WRITE)
                         obd_increase_kms(ll_i2obdexp(inode), lsm, offset);
-                        spin_unlock(&lli->lli_lock);
-                }
         }
 
         OBD_FREE(pga, sizeof(*pga) * iobuf->nr_pages);