Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fad4e83 authored by David Sterba's avatar David Sterba Committed by Chris Mason
Browse files

btrfs: wake up transaction thread from SYNC_FS ioctl



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: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent c01a5c07
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -5288,6 +5288,12 @@ long btrfs_ioctl(struct file *file, unsigned int
		if (ret)
		if (ret)
			return ret;
			return ret;
		ret = btrfs_sync_fs(file->f_dentry->d_sb, 1);
		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;
		return ret;
	}
	}
	case BTRFS_IOC_START_SYNC:
	case BTRFS_IOC_START_SYNC: