Whamcloud - gitweb
LU-14895 client: allow case-insensitive checksum types 30/44530/4
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 30 Jul 2021 21:36:19 +0000 (15:36 -0600)
committerOleg Drokin <green@whamcloud.com>
Sun, 10 Oct 2021 03:31:25 +0000 (03:31 +0000)
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 <adilger@whamcloud.com>
Change-Id: I97673ffa98cf8e5fc601ac7df5aaafb24b3ebbe5
Reviewed-on: https://review.whamcloud.com/44530
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Etienne AUJAMES <eaujames@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdc/lproc_mdc.c
lustre/osc/lproc_osc.c

index 9dc24aa..3b1bbbc 100644 (file)
@@ -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);
index c0fc23e..3be0129 100644 (file)
@@ -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);