[Devel] [PATCH VZ9 2/3] fs/fuse: pcs: force use of crc32c-intel

Alexey Kuznetsov kuznet at virtuozzo.com
Wed Mar 27 18:02:42 MSK 2024


This is workaround, we try to load crc32c-intel tfm explicitly.
And when it is present (and it is), it will be used. It is enough
for now.

Nevertheless, this small patch deserves some comments.
I see this as a probem to be solved.

The problem is that at time when fuse module is loaded module
crc32c-intel is not, so fuse uses very slow default crc implementation.
I do not know any good solution to this. We cannot add an explicit
dependency, as the platform might not support this, or the module
crc32c-intel could be disabled intentionally due to some bugs
in software/hardware. From the other hand normally nobody wants
to use compat crc when good one is available. And actually it is
not our business what crypto module to use, it must be decided
at other level, not us.
BTW /proc/crypto shows there is some other victim, I see one more
user of bad crc module.

Also, investigation showed other pathologies in virtuozzo startup,
which are to be solved this way of another.

1. fuse is put to initrd. I have no idea why dracut does this,
but this is entirely insane as user space required for fuse is still
unavailable. Actually, this is kind of reason why the issue with crc
is triggered, fuse is loaded essentially as the first priority module
like disk driver or ext4 before everything else. Come on!

2. kdump does not work while boot until it enters multiuser mode.
IMHO, this is critical bug. This means that virtuozzo cannot catch,
report or debug any kernel problem which happens before bootup
is complete. I guess this insanity came from redhat which did this
because kdump can be enabled to push dumps to network filesystems.
Yet this does not mean this can be left in this state.

https://pmc.acronis.work/browse/VSTOR-83607

Signed-off-by: Alexey Kuznetsov <kuznet at acronis.com>
---
 fs/fuse/kio/pcs/pcs_fuse_kdirect.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
index 566dcb5..4180aa8 100644
--- a/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
+++ b/fs/fuse/kio/pcs/pcs_fuse_kdirect.c
@@ -1931,6 +1931,9 @@ static int __init kpcs_mod_init(void)
 
 	fuse_trace_root = debugfs_create_dir("fuse", NULL);
 
+	crc_tfm = crypto_alloc_shash("crc32c-intel", 0, 0);
+	if (!crc_tfm || IS_ERR(crc_tfm))
+		crc_tfm = crypto_alloc_shash("crc32c", 0, 0);
 	crc_tfm = crypto_alloc_shash("crc32c", 0, 0);
 	if (IS_ERR(crc_tfm))
 		crc_tfm = NULL;
-- 
1.8.3.1



More information about the Devel mailing list