aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-06-20 12:31:27 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-07-02 11:50:43 -0400
commit925a6efb8ff0c2bdbec107ed9890e62650c83306 (patch)
treecadcb04cee025be381ea986a864c9a15597980ff /fs/btrfs/extent-tree.c
parentb150a4f10d8786a204db1ae3dccada17f950cf54 (diff)
Btrfs: stop using try_to_writeback_inodes_sb_nr to flush delalloc
try_to_writeback_inodes_sb_nr returns 1 if writeback is already underway, which is completely fraking useless for us as we need to make sure pages are actually written before we go and check if there are ordered extents. So replace this with an open coding of try_to_writeback_inodes_sb_nr minus the writeback underway check so that we are sure to actually have flushed some dirty pages out and will have ordered extents to use. With this patch xfstests generic/273 now passes. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index bbd3db7d0833..5154b91f6380 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3943,12 +3943,11 @@ static void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root,
3943 unsigned long nr_pages) 3943 unsigned long nr_pages)
3944{ 3944{
3945 struct super_block *sb = root->fs_info->sb; 3945 struct super_block *sb = root->fs_info->sb;
3946 int started;
3947 3946
3948 /* If we can not start writeback, just sync all the delalloc file. */ 3947 if (down_read_trylock(&sb->s_umount)) {
3949 started = try_to_writeback_inodes_sb_nr(sb, nr_pages, 3948 writeback_inodes_sb_nr(sb, nr_pages, WB_REASON_FS_FREE_SPACE);
3950 WB_REASON_FS_FREE_SPACE); 3949 up_read(&sb->s_umount);
3951 if (!started) { 3950 } else {
3952 /* 3951 /*
3953 * We needn't worry the filesystem going from r/w to r/o though 3952 * We needn't worry the filesystem going from r/w to r/o though
3954 * we don't acquire ->s_umount mutex, because the filesystem 3953 * we don't acquire ->s_umount mutex, because the filesystem