Whamcloud - gitweb
LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP 11/51511/3
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 30 Jun 2023 00:26:44 +0000 (18:26 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Jul 2023 03:09:50 +0000 (03:09 +0000)
Don't return NFS-specific error code ENOTSUPP back to userspace,
instead use EOPNOTSUPP.  ENOTSUPP does not print a useful error
message from strerror() if it is hit by an application.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iabd07b31069737e8ee7ca2382fd8cff6143ebbe5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51511
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/llite/dir.c
lustre/llite/lcommon_misc.c
lustre/llite/lproc_llite.c
lustre/lov/lov_object.c
lustre/mdc/lproc_mdc.c
lustre/mdc/mdc_dev.c
lustre/mdc/mdc_request.c
lustre/osc/lproc_osc.c
lustre/osc/osc_io.c

index 9289bf8..3ec2dde 100644 (file)
@@ -1271,8 +1271,8 @@ int quotactl_ioctl(struct super_block *sb, struct if_quotactl *qctl)
                break;
        default:
                CERROR("%s: unsupported quotactl op: %#x: rc = %d\n",
-                      sbi->ll_fsname, cmd, -ENOTSUPP);
-               RETURN(-ENOTSUPP);
+                      sbi->ll_fsname, cmd, -EOPNOTSUPP);
+               RETURN(-EOPNOTSUPP);
        }
 
        if (valid != QC_GENERAL) {
@@ -1691,7 +1691,7 @@ lmv_out_free:
                case LOV_USER_MAGIC_V1:
                        break;
                default:
-                       GOTO(out, rc = -ENOTSUPP);
+                       GOTO(out, rc = -EOPNOTSUPP);
                }
 
                /* in v1 and v3 cases lumv1 points to data */
@@ -1844,7 +1844,7 @@ finish_req:
                 * on 2.4, we use OBD_CONNECT_LVB_TYPE to detect whether the
                 * server will support REINT_RMENTRY XXX*/
                if (!(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_LVB_TYPE))
-                       RETURN(-ENOTSUPP);
+                       RETURN(-EOPNOTSUPP);
 
                filename = ll_getname(uarg);
                if (IS_ERR(filename))
index 70290ad..d0bfd86 100644 (file)
@@ -144,7 +144,7 @@ int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
                cl_env_put(env, &refcheck);
                /* Does not make sense to take GL for released layout */
                if (rc > 0)
-                       rc = -ENOTSUPP;
+                       rc = -EOPNOTSUPP;
                return rc;
        }
 
index 14be341..67b47ac 100644 (file)
@@ -1079,7 +1079,7 @@ static ssize_t xattr_cache_store(struct kobject *kobj,
                return rc;
 
        if (val && !test_bit(LL_SBI_XATTR_CACHE, sbi->ll_flags))
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
 
        sbi->ll_xattr_cache_enabled = val;
        sbi->ll_xattr_cache_set = 1;
index 9e85b33..16f4bf6 100644 (file)
@@ -1984,12 +1984,12 @@ static int lov_object_fiemap(const struct lu_env *env, struct cl_object *obj,
                if (lsm->lsm_entry_count > 1 ||
                    (lsm->lsm_entry_count == 1 &&
                     lsm->lsm_entries[0]->lsme_stripe_count > 1))
-                       GOTO(out_lsm, rc = -ENOTSUPP);
+                       GOTO(out_lsm, rc = -EOPNOTSUPP);
        }
 
        /* No support for DOM layout yet. */
        if (lsme_is_dom(lsm->lsm_entries[0]))
-               GOTO(out_lsm, rc = -ENOTSUPP);
+               GOTO(out_lsm, rc = -EOPNOTSUPP);
 
        if (lsm->lsm_is_released) {
                if (fiemap->fm_start < fmkey->lfik_oa.o_size) {
index 1dc5803..d813b2b 100644 (file)
@@ -250,7 +250,7 @@ static ssize_t mdc_checksum_type_seq_write(struct file *file,
                                obd->u.cli.cl_cksum_type = BIT(i);
                                rc = count;
                        } else {
-                               rc = -ENOTSUPP;
+                               rc = -EOPNOTSUPP;
                        }
                        break;
                }
index 20298b3..8e5620f 100644 (file)
@@ -1327,7 +1327,7 @@ static void mdc_io_data_version_end(const struct lu_env *env,
                slice->cis_io->ci_result = 0;
                if (!(oio->oi_oa.o_valid &
                      (OBD_MD_LAYOUT_VERSION | OBD_MD_FLDATAVERSION)))
-                       slice->cis_io->ci_result = -ENOTSUPP;
+                       slice->cis_io->ci_result = -EOPNOTSUPP;
 
                if (oio->oi_oa.o_valid & OBD_MD_LAYOUT_VERSION)
                        dv->dv_layout_version = oio->oi_oa.o_layout_version;
index f823075..3bcdd7a 100644 (file)
@@ -107,7 +107,7 @@ static int mdc_get_root(struct obd_export *exp, const char *fileset,
        ENTRY;
 
        if (fileset && !(exp_connect_flags(exp) & OBD_CONNECT_SUBTREE))
-               RETURN(-ENOTSUPP);
+               RETURN(-EOPNOTSUPP);
 
        req = ptlrpc_request_alloc(class_exp2cliimp(exp),
                                &RQF_MDS_GET_ROOT);
index bd55e71..f7f8e3a 100644 (file)
@@ -446,7 +446,7 @@ static ssize_t osc_checksum_type_seq_write(struct file *file,
                                obd->u.cli.cl_cksum_type = BIT(i);
                                rc = count;
                        } else {
-                               rc = -ENOTSUPP;
+                               rc = -EOPNOTSUPP;
                        }
                        break;
                }
index 543f772..93b708b 100644 (file)
@@ -862,7 +862,7 @@ static void osc_io_data_version_end(const struct lu_env *env,
                slice->cis_io->ci_result = 0;
                if (!(oa->o_valid &
                      (OBD_MD_LAYOUT_VERSION | OBD_MD_FLDATAVERSION)))
-                       slice->cis_io->ci_result = -ENOTSUPP;
+                       slice->cis_io->ci_result = -EOPNOTSUPP;
 
                if (oa->o_valid & OBD_MD_LAYOUT_VERSION)
                        dv->dv_layout_version = oa->o_layout_version;