Whamcloud - gitweb
LU-14895 client: allow case-insensitive checksum types
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 30 Jul 2021 21:36:19 +0000 (15:36 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 16 Sep 2021 21:02:03 +0000 (21:02 +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.

Lustre-change: https://review.whamcloud.com/44530
Lustre-commit: TBD (from 48a8218fdd0d0ed876fb39d29542fd1751c2e341)

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I97673ffa98cf8e5fc601ac7df5aaafb24b3ebbe5
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44940
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/mdc/lproc_mdc.c
lustre/osc/lproc_osc.c

index b3b4947..c056c3b 100644 (file)
@@ -240,7 +240,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 175433d..f81853f 100644 (file)
@@ -435,7 +435,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);