From 1cf7a8d46ca7a5b446e4f579c82f5f643f4c8650 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 30 Jul 2021 15:36:19 -0600 Subject: [PATCH] LU-14895 client: allow case-insensitive checksum types The current t10ip4K and t10crc4K checksum types use an upper-case 'K' in the name, unlike the other checksum types which are all lower-case. This is distinction is difficult to see in some fonts, and can cause usage errors. Accept upper-case variants of the checksum type names. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: I97673ffa98cf8e5fc601ac7df5aaafb24b3ebbe5 Reviewed-on: https://review.whamcloud.com/44530 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Li Dongyang Reviewed-by: Etienne AUJAMES Reviewed-by: Oleg Drokin --- lustre/mdc/lproc_mdc.c | 2 +- lustre/osc/lproc_osc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/mdc/lproc_mdc.c b/lustre/mdc/lproc_mdc.c index 9dc24aa..3b1bbbc 100644 --- a/lustre/mdc/lproc_mdc.c +++ b/lustre/mdc/lproc_mdc.c @@ -244,7 +244,7 @@ static ssize_t mdc_checksum_type_seq_write(struct file *file, kernbuf[count] = '\0'; for (i = 0; i < ARRAY_SIZE(cksum_name); i++) { - if (strcmp(kernbuf, cksum_name[i]) == 0) { + if (strcasecmp(kernbuf, cksum_name[i]) == 0) { obd->u.cli.cl_preferred_cksum_type = BIT(i); if (obd->u.cli.cl_supp_cksum_types & BIT(i)) { obd->u.cli.cl_cksum_type = BIT(i); diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index c0fc23e..3be0129 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -440,7 +440,7 @@ static ssize_t osc_checksum_type_seq_write(struct file *file, kernbuf[count] = '\0'; for (i = 0; i < ARRAY_SIZE(cksum_name); i++) { - if (strcmp(kernbuf, cksum_name[i]) == 0) { + if (strcasecmp(kernbuf, cksum_name[i]) == 0) { obd->u.cli.cl_preferred_cksum_type = BIT(i); if (obd->u.cli.cl_supp_cksum_types & BIT(i)) { obd->u.cli.cl_cksum_type = BIT(i); -- 1.8.3.1