diff options
author | David S. Miller <davem@davemloft.net> | 2019-01-21 17:41:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-21 17:41:32 -0500 |
commit | fa7f3a8d56b38a3ed1880a3780afba82387da277 (patch) | |
tree | a4628ee966f21963e5e97a6d1a227a3e8138183e /fs/btrfs/disk-io.c | |
parent | 28f9d1a3d4fecdb2352d3984ddeec88146385885 (diff) | |
parent | 49a57857aeea06ca831043acbb0fa5e0f50602fd (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Completely minor snmp doc conflict.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 8da2f380d3c0..6a2a2a951705 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1682,6 +1682,8 @@ static int cleaner_kthread(void *arg) | |||
1682 | while (1) { | 1682 | while (1) { |
1683 | again = 0; | 1683 | again = 0; |
1684 | 1684 | ||
1685 | set_bit(BTRFS_FS_CLEANER_RUNNING, &fs_info->flags); | ||
1686 | |||
1685 | /* Make the cleaner go to sleep early. */ | 1687 | /* Make the cleaner go to sleep early. */ |
1686 | if (btrfs_need_cleaner_sleep(fs_info)) | 1688 | if (btrfs_need_cleaner_sleep(fs_info)) |
1687 | goto sleep; | 1689 | goto sleep; |
@@ -1728,6 +1730,7 @@ static int cleaner_kthread(void *arg) | |||
1728 | */ | 1730 | */ |
1729 | btrfs_delete_unused_bgs(fs_info); | 1731 | btrfs_delete_unused_bgs(fs_info); |
1730 | sleep: | 1732 | sleep: |
1733 | clear_bit(BTRFS_FS_CLEANER_RUNNING, &fs_info->flags); | ||
1731 | if (kthread_should_park()) | 1734 | if (kthread_should_park()) |
1732 | kthread_parkme(); | 1735 | kthread_parkme(); |
1733 | if (kthread_should_stop()) | 1736 | if (kthread_should_stop()) |
@@ -4201,6 +4204,14 @@ static void btrfs_destroy_all_ordered_extents(struct btrfs_fs_info *fs_info) | |||
4201 | spin_lock(&fs_info->ordered_root_lock); | 4204 | spin_lock(&fs_info->ordered_root_lock); |
4202 | } | 4205 | } |
4203 | spin_unlock(&fs_info->ordered_root_lock); | 4206 | spin_unlock(&fs_info->ordered_root_lock); |
4207 | |||
4208 | /* | ||
4209 | * We need this here because if we've been flipped read-only we won't | ||
4210 | * get sync() from the umount, so we need to make sure any ordered | ||
4211 | * extents that haven't had their dirty pages IO start writeout yet | ||
4212 | * actually get run and error out properly. | ||
4213 | */ | ||
4214 | btrfs_wait_ordered_roots(fs_info, U64_MAX, 0, (u64)-1); | ||
4204 | } | 4215 | } |
4205 | 4216 | ||
4206 | static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, | 4217 | static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, |
@@ -4265,6 +4276,7 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, | |||
4265 | if (pin_bytes) | 4276 | if (pin_bytes) |
4266 | btrfs_pin_extent(fs_info, head->bytenr, | 4277 | btrfs_pin_extent(fs_info, head->bytenr, |
4267 | head->num_bytes, 1); | 4278 | head->num_bytes, 1); |
4279 | btrfs_cleanup_ref_head_accounting(fs_info, delayed_refs, head); | ||
4268 | btrfs_put_delayed_ref_head(head); | 4280 | btrfs_put_delayed_ref_head(head); |
4269 | cond_resched(); | 4281 | cond_resched(); |
4270 | spin_lock(&delayed_refs->lock); | 4282 | spin_lock(&delayed_refs->lock); |