Whamcloud - gitweb
LU-639 obdclass: wait obd cleanup before mount
authorBobi Jam <bobijam@whamcloud.com>
Tue, 20 Dec 2011 09:59:07 +0000 (17:59 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 4 Jan 2012 18:45:44 +0000 (13:45 -0500)
Obd device cleanup is executed by obd zombie thread, and umount thread
can return successfully before obd zomebie finishes its job. In some
cases, especially in test cases, a test may starts before last tests
finishes obd cleanup, this patch makes mount thread wait for obd
zombie finishes its job.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I881be5de18960867c36e8c4e4180c0c594d88a01
Reviewed-on: http://review.whamcloud.com/1896
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/obd_mount.c

index 8c50cfb..39fe240 100644 (file)
@@ -2267,6 +2267,11 @@ int lustre_fill_super(struct super_block *sb, void *data, int silent)
          */
         cfs_lockdep_off();
 
          */
         cfs_lockdep_off();
 
+        /*
+         * LU-639: the obd cleanup of last mount may not finish yet, wait here.
+         */
+        obd_zombie_barrier();
+
         /* Figure out the lmd from the mount options */
         if (lmd_parse((char *)(lmd2->lmd2_data), lmd)) {
                 lustre_put_lsi(sb);
         /* Figure out the lmd from the mount options */
         if (lmd_parse((char *)(lmd2->lmd2_data), lmd)) {
                 lustre_put_lsi(sb);