@@ -28,6 +28,7 @@
#include <linux/btrfs.h>
#include <linux/security.h>
#include <linux/fs_parser.h>
+#include <linux/fsverity.h>
#include "messages.h"
#include "delayed-inode.h"
#include "ctree.h"
@@ -924,6 +925,19 @@ static int btrfs_fill_super(struct super_block *sb,
sb->s_export_op = &btrfs_export_ops;
#ifdef CONFIG_FS_VERITY
sb->s_vop = &btrfs_verityops;
+ /*
+ * Use a high-priority workqueue to prioritize verification work, which
+ * blocks reads from completing, over regular application tasks.
+ *
+ * For performance reasons, don't use an unbound workqueue. Using an
+ * unbound workqueue for crypto operations causes excessive scheduler
+ * latency on ARM64.
+ */
+ err = fsverity_init_wq(sb, WQ_HIGHPRI, num_online_cpus());
+ if (err) {
+ btrfs_err(fs_info, "fsverity_init_wq failed");
+ return err;
+ }
#endif
sb->s_xattr = btrfs_xattr_handlers;
sb->s_time_gran = 1;