]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.16.7/btrfs-wake-up-transaction-thread-from-sync_fs-ioctl.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.7 / btrfs-wake-up-transaction-thread-from-sync_fs-ioctl.patch
1 From 2fad4e83e12591eb3bd213875b9edc2d18e93383 Mon Sep 17 00:00:00 2001
2 From: David Sterba <dsterba@suse.cz>
3 Date: Wed, 23 Jul 2014 14:39:35 +0200
4 Subject: btrfs: wake up transaction thread from SYNC_FS ioctl
5
6 From: David Sterba <dsterba@suse.cz>
7
8 commit 2fad4e83e12591eb3bd213875b9edc2d18e93383 upstream.
9
10 The transaction thread may want to do more work, namely it pokes the
11 cleaner ktread that will start processing uncleaned subvols.
12
13 This can be triggered by user via the 'btrfs fi sync' command, otherwise
14 there was a delay up to 30 seconds before the cleaner started to clean
15 old snapshots.
16
17 Signed-off-by: David Sterba <dsterba@suse.cz>
18 Signed-off-by: Chris Mason <clm@fb.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21 ---
22 fs/btrfs/ioctl.c | 6 ++++++
23 1 file changed, 6 insertions(+)
24
25 --- a/fs/btrfs/ioctl.c
26 +++ b/fs/btrfs/ioctl.c
27 @@ -5309,6 +5309,12 @@ long btrfs_ioctl(struct file *file, unsi
28 if (ret)
29 return ret;
30 ret = btrfs_sync_fs(file->f_dentry->d_sb, 1);
31 + /*
32 + * The transaction thread may want to do more work,
33 + * namely it pokes the cleaner ktread that will start
34 + * processing uncleaned subvols.
35 + */
36 + wake_up_process(root->fs_info->transaction_kthread);
37 return ret;
38 }
39 case BTRFS_IOC_START_SYNC: