Browse Source

Btrfs: only flush down bios for writeback pages

The btrfs write_cache_pages call has a flush function so that it submits
the bio it has been building before it waits on any writeback pages.

This adds a check so that flush only happens on writeback pages.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Chris Mason 17 years ago
parent
commit
0e6bd956ed
1 changed files with 2 additions and 1 deletions
  1. 2 1
      fs/btrfs/extent_io.c

+ 2 - 1
fs/btrfs/extent_io.c

@@ -2462,7 +2462,8 @@ retry:
 			}
 
 			if (wbc->sync_mode != WB_SYNC_NONE) {
-				flush_fn(data);
+				if (PageWriteback(page))
+					flush_fn(data);
 				wait_on_page_writeback(page);
 			}