Whamcloud - gitweb
file jbd-stats-2.6.9.patch was initially added on branch b1_4.
[fs/lustre-release.git] / lustre / llite / rw26.c
index ec37b0a..ea8ae29 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)
+        /* this synchronization (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;
 }