Whamcloud - gitweb
- ll_writepages() waits for I/O completion if filesystem is being umounted
authoralex <alex>
Mon, 29 Aug 2005 10:30:37 +0000 (10:30 +0000)
committeralex <alex>
Mon, 29 Aug 2005 10:30:37 +0000 (10:30 +0000)
lustre/llite/llite_internal.h
lustre/llite/rw26.c
lustre/llite/super25.c

index 9d6a04f..dc32a6c 100644 (file)
@@ -505,6 +505,7 @@ int ll_get_fid(struct obd_export *exp, struct lustre_id *idp,
 /* generic */
 #define LL_SBI_NOLCK           0x1
 #define LL_SBI_READAHEAD       0x2
+#define LL_SBI_UMOUNT          0x4
 #define LL_SUPER_MAGIC         0x0BD00BD0
 #define LL_MAX_BLKSIZE         (4UL * 1024 * 1024)
 
index ec37b0a..eb9162f 100644 (file)
@@ -79,17 +79,16 @@ static int ll_releasepage(struct page *page, int gfp_mask)
 static int ll_writepages(struct address_space *mapping,
                          struct writeback_control *wbc)
 {
+        struct ll_sb_info *sbi = ll_s2sbi(mapping->host->i_sb);
         int rc;
-#if 0
         struct timeval tstart, now;
         do_gettimeofday(&tstart);
-#endif
         rc =  generic_writepages(mapping, wbc);
-#if 0
         /* this syncronization (even being implemented via Writeback)
          * makes recovery much more sad, because iget() can get stuck
          * on I_LOCK the kernel helds over ->writepages() -bzzz */
-        if (rc == 0 && wbc->sync_mode == WB_SYNC_ALL) {
+        if (rc == 0 && wbc->sync_mode == WB_SYNC_ALL
+                        && sbi->ll_flags & LL_SBI_UMOUNT) {
                 /* as we don't use Writeback bit to track pages
                  * under I/O, filemap_fdatawait() doesn't work
                  * for us. let's wait for I/O completion here */
@@ -104,7 +103,6 @@ static int ll_writepages(struct address_space *mapping,
                         portals_debug_dumplog();
                 }
         }
-#endif
         return rc;
 }
 
index 0d55f05..98e1830 100644 (file)
@@ -101,6 +101,8 @@ void ll_destroy_inodecache(void)
 static void ll_umount_lustre(struct super_block *sb)
 {
         struct ll_sb_info *sbi = ll_s2sbi(sb);
+        LASSERT((sbi->ll_flags & LL_SBI_UMOUNT) == 0);
+        sbi->ll_flags |= LL_SBI_UMOUNT;
         ll_gns_check_mounts(sbi, LL_GNS_UMOUNT);
 }