mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
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>
This commit is contained in:
parent
b150a4f10d
commit
925a6efb8f
@ -3943,12 +3943,11 @@ static void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root,
|
|||||||
unsigned long nr_pages)
|
unsigned long nr_pages)
|
||||||
{
|
{
|
||||||
struct super_block *sb = root->fs_info->sb;
|
struct super_block *sb = root->fs_info->sb;
|
||||||
int started;
|
|
||||||
|
|
||||||
/* If we can not start writeback, just sync all the delalloc file. */
|
if (down_read_trylock(&sb->s_umount)) {
|
||||||
started = try_to_writeback_inodes_sb_nr(sb, nr_pages,
|
writeback_inodes_sb_nr(sb, nr_pages, WB_REASON_FS_FREE_SPACE);
|
||||||
WB_REASON_FS_FREE_SPACE);
|
up_read(&sb->s_umount);
|
||||||
if (!started) {
|
} else {
|
||||||
/*
|
/*
|
||||||
* We needn't worry the filesystem going from r/w to r/o though
|
* We needn't worry the filesystem going from r/w to r/o though
|
||||||
* we don't acquire ->s_umount mutex, because the filesystem
|
* we don't acquire ->s_umount mutex, because the filesystem
|
||||||
|
Loading…
Reference in New Issue
Block a user