Skip to content

Commit 2c40519

Browse files
committed
Merge tag 'for-6.3-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fixes from David Sterba: - fix fast checksum detection, this affects filesystems with non-crc32c checksum, calculation would not be offloaded to worker threads - restore thread_pool mount option behaviour for endio workers, the new value for maximum active threads would not be set to the actual work queues * tag 'for-6.3-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: fix fast csum implementation detection btrfs: restore the thread_pool= behavior in remount for the end I/O workqueues
2 parents 793cfd5 + 68d99ab commit 2c40519

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

fs/btrfs/disk-io.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,6 +2250,20 @@ static int btrfs_init_csum_hash(struct btrfs_fs_info *fs_info, u16 csum_type)
22502250

22512251
fs_info->csum_shash = csum_shash;
22522252

2253+
/*
2254+
* Check if the checksum implementation is a fast accelerated one.
2255+
* As-is this is a bit of a hack and should be replaced once the csum
2256+
* implementations provide that information themselves.
2257+
*/
2258+
switch (csum_type) {
2259+
case BTRFS_CSUM_TYPE_CRC32:
2260+
if (!strstr(crypto_shash_driver_name(csum_shash), "generic"))
2261+
set_bit(BTRFS_FS_CSUM_IMPL_FAST, &fs_info->flags);
2262+
break;
2263+
default:
2264+
break;
2265+
}
2266+
22532267
btrfs_info(fs_info, "using %s (%s) checksum algorithm",
22542268
btrfs_super_csum_name(csum_type),
22552269
crypto_shash_driver_name(csum_shash));

fs/btrfs/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,8 +1516,6 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
15161516
shrinker_debugfs_rename(&s->s_shrink, "sb-%s:%s", fs_type->name,
15171517
s->s_id);
15181518
btrfs_sb(s)->bdev_holder = fs_type;
1519-
if (!strstr(crc32c_impl(), "generic"))
1520-
set_bit(BTRFS_FS_CSUM_IMPL_FAST, &fs_info->flags);
15211519
error = btrfs_fill_super(s, fs_devices, data);
15221520
}
15231521
if (!error)
@@ -1631,6 +1629,8 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info,
16311629
btrfs_workqueue_set_max(fs_info->hipri_workers, new_pool_size);
16321630
btrfs_workqueue_set_max(fs_info->delalloc_workers, new_pool_size);
16331631
btrfs_workqueue_set_max(fs_info->caching_workers, new_pool_size);
1632+
workqueue_set_max_active(fs_info->endio_workers, new_pool_size);
1633+
workqueue_set_max_active(fs_info->endio_meta_workers, new_pool_size);
16341634
btrfs_workqueue_set_max(fs_info->endio_write_workers, new_pool_size);
16351635
btrfs_workqueue_set_max(fs_info->endio_freespace_worker, new_pool_size);
16361636
btrfs_workqueue_set_max(fs_info->delayed_workers, new_pool_size);

0 commit comments

Comments
 (0)