Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Btrfs: don't call writepages from within write_full_page

When doing a writepage we call writepages to try and write out any other dirty
pages in the area. This could cause problems where we commit a transaction and
then have somebody else dirtying metadata in the area as we could end up writing
out a lot more than we care about, which could cause latency on anybody who is
waiting for the transaction to completely finish committing. Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

authored by

Josef Bacik and committed by
Chris Mason
0d10ee2e 341d14f1

-10
-10
fs/btrfs/extent_io.c
··· 2502 2502 struct writeback_control *wbc) 2503 2503 { 2504 2504 int ret; 2505 - struct address_space *mapping = page->mapping; 2506 2505 struct extent_page_data epd = { 2507 2506 .bio = NULL, 2508 2507 .tree = tree, ··· 2509 2510 .extent_locked = 0, 2510 2511 .sync_io = wbc->sync_mode == WB_SYNC_ALL, 2511 2512 }; 2512 - struct writeback_control wbc_writepages = { 2513 - .sync_mode = wbc->sync_mode, 2514 - .older_than_this = NULL, 2515 - .nr_to_write = 64, 2516 - .range_start = page_offset(page) + PAGE_CACHE_SIZE, 2517 - .range_end = (loff_t)-1, 2518 - }; 2519 2513 2520 2514 ret = __extent_writepage(page, wbc, &epd); 2521 2515 2522 - extent_write_cache_pages(tree, mapping, &wbc_writepages, 2523 - __extent_writepage, &epd, flush_write_bio); 2524 2516 flush_epd_write_bio(&epd); 2525 2517 return ret; 2526 2518 }