Whamcloud - gitweb
jbd2 spinlock hang fix for rhel5 and added error check
authorRahul Deshmukh <Rahul.Deshmukh@Sun.COM>
Fri, 22 Jan 2010 02:42:24 +0000 (08:12 +0530)
committerRobert Read <rread@sun.com>
Fri, 22 Jan 2010 18:34:02 +0000 (10:34 -0800)
b=21595 mdsrate-create-large.sh, BUG: soft lockup - CPU#0 stuck for 10s!
[ll_ost_io_04:8153]

jbd2 spinlock hang fix for rhel5 and added error check

i=johann
i=girish

lustre/kernel_patches/patches/jbd2-jcberr-2.6-rhel5.patch
lustre/obdfilter/filter.c

index 2933591..5c15956 100644 (file)
@@ -101,12 +101,12 @@ Index: linux-2.6.18-128.1.6/fs/jbd2/checkpoint.c
  
 Index: linux-2.6.18-128.1.6/fs/jbd2/commit.c
 ===================================================================
  
 Index: linux-2.6.18-128.1.6/fs/jbd2/commit.c
 ===================================================================
---- linux-2.6.18-128.1.6.orig/fs/jbd2/commit.c 2009-04-15 08:35:28.000000000 +0530
-+++ linux-2.6.18-128.1.6/fs/jbd2/commit.c      2009-05-28 15:12:45.000000000 +0530
-@@ -898,6 +898,30 @@
+--- linux-2.6.18-164.6.1/fs/jbd2/commit.c      2010-01-21 11:24:52.000000000 +0530
++++ linux-2.6.18-164.6.1_new/fs/jbd2/commit.c  2010-01-21 11:26:36.000000000 +0530
+@@ -832,6 +832,29 @@ wait_for_iobuf:
+            processing: any buffers committed as a result of this
             transaction can be removed from any checkpoint list it was on
             before. */
             transaction can be removed from any checkpoint list it was on
             before. */
 +      /*
 +       * Call any callbacks that had been registered for handles in this
 +       * transaction.  It is up to the callback to free any allocated
 +      /*
 +       * Call any callbacks that had been registered for handles in this
 +       * transaction.  It is up to the callback to free any allocated
@@ -130,10 +130,9 @@ Index: linux-2.6.18-128.1.6/fs/jbd2/commit.c
 +              }
 +      }
 +      spin_unlock(&commit_transaction->t_jcb_lock);
 +              }
 +      }
 +      spin_unlock(&commit_transaction->t_jcb_lock);
-+
-       jbd_debug(3, "JBD: commit phase 7\n");
  
  
-       J_ASSERT(commit_transaction->t_sync_datalist == NULL);
+       jbd_debug(3, "JBD: commit phase 6\n");
 Index: linux-2.6.18-128.1.6/fs/jbd2/journal.c
 ===================================================================
 --- linux-2.6.18-128.1.6.orig/fs/jbd2/journal.c        2009-04-15 08:35:28.000000000 +0530
 Index: linux-2.6.18-128.1.6/fs/jbd2/journal.c
 ===================================================================
 --- linux-2.6.18-128.1.6.orig/fs/jbd2/journal.c        2009-04-15 08:35:28.000000000 +0530
index 1d062b4..94c66d6 100644 (file)
@@ -1564,7 +1564,7 @@ static int filter_prepare_destroy(struct obd_device *obd, obd_id objid,
 static void filter_fini_destroy(struct obd_device *obd,
                                 struct lustre_handle *lockh)
 {
 static void filter_fini_destroy(struct obd_device *obd,
                                 struct lustre_handle *lockh)
 {
-        if (lockh->cookie)
+        if (lustre_handle_is_used(lockh))
                 ldlm_lock_decref(lockh, LCK_PW);
 }
 
                 ldlm_lock_decref(lockh, LCK_PW);
 }
 
@@ -4089,7 +4089,9 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
                 GOTO(cleanup, rc = -ENOENT);
         }
 
                 GOTO(cleanup, rc = -ENOENT);
         }
 
-        filter_prepare_destroy(obd, oa->o_id, oa->o_gr, &lockh);
+        rc = filter_prepare_destroy(obd, oa->o_id, oa->o_gr, &lockh);
+        if (rc)
+                GOTO(cleanup, rc);
 
         /* Our MDC connection is established by the MDS to us */
         if (oa->o_valid & OBD_MD_FLCOOKIE) {
 
         /* Our MDC connection is established by the MDS to us */
         if (oa->o_valid & OBD_MD_FLCOOKIE) {