e464725
From: David Sterba <dsterba@suse.cz>
e464725
Date: Wed, 23 Jul 2014 14:39:35 +0200
e464725
Subject: [PATCH] btrfs: wake up transaction thread from SYNC_FS ioctl
e464725
e464725
(cherry picked from commit 2fad4e83e12591eb3bd213875b9edc2d18e93383)
e464725
e464725
The transaction thread may want to do more work, namely it pokes the
e464725
cleaner ktread that will start processing uncleaned subvols.
e464725
e464725
This can be triggered by user via the 'btrfs fi sync' command, otherwise
e464725
there was a delay up to 30 seconds before the cleaner started to clean
e464725
old snapshots.
e464725
e464725
Signed-off-by: David Sterba <dsterba@suse.cz>
e464725
Signed-off-by: Chris Mason <clm@fb.com>
e464725
---
e464725
 fs/btrfs/ioctl.c | 6 ++++++
e464725
 1 file changed, 6 insertions(+)
e464725
e464725
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
e464725
index 8a8e29878c34..13d577b39bfa 100644
e464725
--- a/fs/btrfs/ioctl.c
e464725
+++ b/fs/btrfs/ioctl.c
e464725
@@ -5283,6 +5283,12 @@ long btrfs_ioctl(struct file *file, unsigned int
e464725
 		if (ret)
e464725
 			return ret;
e464725
 		ret = btrfs_sync_fs(file->f_dentry->d_sb, 1);
e464725
+		/*
e464725
+		 * The transaction thread may want to do more work,
e464725
+		 * namely it pokes the cleaner ktread that will start
e464725
+		 * processing uncleaned subvols.
e464725
+		 */
e464725
+		wake_up_process(root->fs_info->transaction_kthread);
e464725
 		return ret;
e464725
 	}
e464725
 	case BTRFS_IOC_START_SYNC:
e464725
-- 
e464725
1.9.3
e464725