Commit 6d752cac authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: directly wake up cleaner kthread in the BTRFS_IOC_SYNC ioctl

The BTRFS_IOC_SYNC ioctl wants to wake up the cleaner kthread so that it
does any pending work (subvolume deletion, delayed iputs, etc), however
it is waking up the transaction kthread, which in turn wakes up the
cleaner. Since we don't have any transaction to commit, as any ongoing
transaction was already committed when it called btrfs_sync_fs() and
the goal is just to wake up the cleaner thread, directly wake up the
cleaner instead of the transaction kthread.
Reviewed-by: default avatarBoris Burkov <boris@bur.io>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent efffb803
...@@ -4765,11 +4765,10 @@ long btrfs_ioctl(struct file *file, unsigned int ...@@ -4765,11 +4765,10 @@ long btrfs_ioctl(struct file *file, unsigned int
return ret; return ret;
ret = btrfs_sync_fs(inode->i_sb, 1); ret = btrfs_sync_fs(inode->i_sb, 1);
/* /*
* The transaction thread may want to do more work, * There may be work for the cleaner kthread to do (subvolume
* namely it pokes the cleaner kthread that will start * deletion, delayed iputs, defrag inodes, etc), so wake it up.
* processing uncleaned subvols.
*/ */
wake_up_process(fs_info->transaction_kthread); wake_up_process(fs_info->cleaner_kthread);
return ret; return ret;
} }
case BTRFS_IOC_START_SYNC: case BTRFS_IOC_START_SYNC:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment