Whamcloud - gitweb
LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 30 Jun 2023 00:19:06 +0000 (18:19 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 1 Jul 2023 10:06:15 +0000 (04:06 -0600)
Don't return NFS-specific error code ENOTSUPP back to userspace,
instead use EOPNOTSUPP.

Lustre-change: https://review.whamcloud.com/51511
Lustre-commit: TBD (from 1a0d553000d5a869f9039bab74dbdbb20d4259b0)

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iabd07b31069737e8ee7ca2382fd8cff6143ebbe5

lustre/llite/dir.c
lustre/llite/lcommon_misc.c
lustre/llite/lproc_llite.c
lustre/llite/pcc.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
lustre/ptlrpc/pack_generic.c

index dba2477..4894ca7 100644 (file)
@@ -1224,7 +1224,7 @@ int quotactl_ioctl(struct super_block *sb, struct if_quotactl *qctl)
                break;
        default:
                CERROR("unsupported quotactl op: %#x\n", cmd);
-               RETURN(-ENOTSUPP);
+               RETURN(-EOPNOTSUPP);
        }
 
        if (valid != QC_GENERAL) {
@@ -1517,7 +1517,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
         * to send them to the MDS/OST as appropriate and to properly
         * network encode the arg field. */
        case FS_IOC_SETVERSION:
-               RETURN(-ENOTSUPP);
+               RETURN(-EOPNOTSUPP);
 
        case LL_IOC_GET_MDTIDX: {
                int mdtidx;
@@ -1673,7 +1673,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 */
@@ -1873,7 +1873,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((const char __user *)arg);
                if (IS_ERR(filename))
index cf4659d..93a49d8 100644 (file)
@@ -145,7 +145,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 cd28ab1..fbff1cf 100644 (file)
@@ -1248,7 +1248,7 @@ static ssize_t xattr_cache_store(struct kobject *kobj,
                return rc;
 
        if (val && !(sbi->ll_flags & LL_SBI_XATTR_CACHE))
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
 
        sbi->ll_xattr_cache_enabled = val;
        sbi->ll_xattr_cache_set = 1;
index 20bdac5..3aa1fb6 100644 (file)
@@ -4339,7 +4339,7 @@ static int pcc_readonly_attach_sync(struct file *file, struct inode *inode,
        ENTRY;
 
        if (!(ll_i2sbi(inode)->ll_flags & LL_SBI_LAYOUT_LOCK))
-               RETURN(-ENOTSUPP);
+               RETURN(-EOPNOTSUPP);
 
        rc = pcc_attach_check_set(inode);
        if (rc) {
@@ -4371,7 +4371,7 @@ int pcc_ioctl_attach(struct file *file, struct inode *inode,
 
        switch (attach->pcca_type & LU_PCC_TYPE_MASK) {
        case LU_PCC_READWRITE:
-               rc = -ENOTSUPP;
+               rc = -EOPNOTSUPP;
                break;
        case LU_PCC_READONLY:
                if (attach->pcca_type & LU_PCC_FL_ASYNC &&
index d316c5c..558dfdd 100644 (file)
@@ -1993,12 +1993,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 f0b79e9..09457f1 100644 (file)
@@ -248,7 +248,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 96e896c..af89311 100644 (file)
@@ -1305,7 +1305,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 9a97281..96c6634 100644 (file)
@@ -108,7 +108,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 a61300e..9e812dd 100644 (file)
@@ -443,7 +443,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 c706048..eccafeb 100644 (file)
@@ -842,7 +842,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;
index 2ffd4df..e7c5006 100644 (file)
@@ -2546,7 +2546,7 @@ int lustre_check_lov_comp_md_v1(struct lov_comp_md_v1 *lum)
                ent = &lum->lcm_entries[i];
                if (!llite_enable_compression &&
                    ent->lcme_compr_type != LL_COMPR_TYPE_NONE) {
-                       return -ENOTSUPP;
+                       return -EOPNOTSUPP;
                }
        }
        return rc;