]> git.hungrycats.org Git - linux/commitdiff
btrfs: wake up transaction thread from SYNC_FS ioctl
authorDavid Sterba <dsterba@suse.cz>
Wed, 23 Jul 2014 12:39:35 +0000 (14:39 +0200)
committerJiri Slaby <jslaby@suse.cz>
Fri, 31 Oct 2014 14:11:04 +0000 (15:11 +0100)
commit 2fad4e83e12591eb3bd213875b9edc2d18e93383 upstream.

The transaction thread may want to do more work, namely it pokes the
cleaner ktread that will start processing uncleaned subvols.

This can be triggered by user via the 'btrfs fi sync' command, otherwise
there was a delay up to 30 seconds before the cleaner started to clean
old snapshots.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/btrfs/ioctl.c

index ad6a08c5801ecd04716c89f85d9d7d11bd052007..50a06debb1bde5a9fb37b7a806cd35e8bd39b2e4 100644 (file)
@@ -4571,6 +4571,12 @@ long btrfs_ioctl(struct file *file, unsigned int
                if (ret)
                        return ret;
                ret = btrfs_sync_fs(file->f_dentry->d_sb, 1);
+               /*
+                * The transaction thread may want to do more work,
+                * namely it pokes the cleaner ktread that will start
+                * processing uncleaned subvols.
+                */
+               wake_up_process(root->fs_info->transaction_kthread);
                return ret;
        }
        case BTRFS_IOC_START_SYNC: