diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-20 19:24:02 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-20 19:24:02 -0400 |
| commit | ff446f2001cf9b5ed97c6256c4ee3549d3b7abed (patch) | |
| tree | ec5fd60a8b9c21ae85eaa99003f26e6c342e2234 /fs/btrfs/ordered-data.c | |
| parent | 78091dc2f6f04b03131218df590c877cadcd9379 (diff) | |
| parent | 485802a6c524e62b5924849dd727ddbb1497cc71 (diff) | |
Merge 3.5-rc3 into usb-next
This lets us catch the USB fixes that went into 3.5-rc3 into this branch,
as we want them here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
| -rw-r--r-- | fs/btrfs/ordered-data.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 9e138cdc36c5..643335a4fe3c 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
| @@ -627,7 +627,27 @@ void btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len) | |||
| 627 | /* start IO across the range first to instantiate any delalloc | 627 | /* start IO across the range first to instantiate any delalloc |
| 628 | * extents | 628 | * extents |
| 629 | */ | 629 | */ |
| 630 | filemap_write_and_wait_range(inode->i_mapping, start, orig_end); | 630 | filemap_fdatawrite_range(inode->i_mapping, start, orig_end); |
| 631 | |||
| 632 | /* | ||
| 633 | * So with compression we will find and lock a dirty page and clear the | ||
| 634 | * first one as dirty, setup an async extent, and immediately return | ||
| 635 | * with the entire range locked but with nobody actually marked with | ||
| 636 | * writeback. So we can't just filemap_write_and_wait_range() and | ||
| 637 | * expect it to work since it will just kick off a thread to do the | ||
| 638 | * actual work. So we need to call filemap_fdatawrite_range _again_ | ||
| 639 | * since it will wait on the page lock, which won't be unlocked until | ||
| 640 | * after the pages have been marked as writeback and so we're good to go | ||
| 641 | * from there. We have to do this otherwise we'll miss the ordered | ||
| 642 | * extents and that results in badness. Please Josef, do not think you | ||
| 643 | * know better and pull this out at some point in the future, it is | ||
| 644 | * right and you are wrong. | ||
| 645 | */ | ||
| 646 | if (test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, | ||
| 647 | &BTRFS_I(inode)->runtime_flags)) | ||
| 648 | filemap_fdatawrite_range(inode->i_mapping, start, orig_end); | ||
| 649 | |||
| 650 | filemap_fdatawait_range(inode->i_mapping, start, orig_end); | ||
| 631 | 651 | ||
| 632 | end = orig_end; | 652 | end = orig_end; |
| 633 | found = 0; | 653 | found = 0; |
