From ffd2fc1e17822c013d7790cc8247361c567792af Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Thu, 29 Jun 2023 18:26:44 -0600 Subject: [PATCH] LU-14301 client: use EOPNOTSUPP instead of ENOTSUPP 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 Change-Id: Iabd07b31069737e8ee7ca2382fd8cff6143ebbe5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51511 Reviewed-by: Oleg Drokin Reviewed-by: Neil Brown Reviewed-by: jsimmons Tested-by: jenkins Tested-by: Maloo --- lustre/llite/dir.c | 8 ++++---- lustre/llite/lcommon_misc.c | 2 +- lustre/llite/lproc_llite.c | 2 +- lustre/lov/lov_object.c | 4 ++-- lustre/mdc/lproc_mdc.c | 2 +- lustre/mdc/mdc_dev.c | 2 +- lustre/mdc/mdc_request.c | 2 +- lustre/osc/lproc_osc.c | 2 +- lustre/osc/osc_io.c | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 9289bf8..3ec2dde 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -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)) diff --git a/lustre/llite/lcommon_misc.c b/lustre/llite/lcommon_misc.c index 70290ad..d0bfd86 100644 --- a/lustre/llite/lcommon_misc.c +++ b/lustre/llite/lcommon_misc.c @@ -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; } diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 14be341..67b47ac 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -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; diff --git a/lustre/lov/lov_object.c b/lustre/lov/lov_object.c index 9e85b33..16f4bf6 100644 --- a/lustre/lov/lov_object.c +++ b/lustre/lov/lov_object.c @@ -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) { diff --git a/lustre/mdc/lproc_mdc.c b/lustre/mdc/lproc_mdc.c index 1dc5803..d813b2b 100644 --- a/lustre/mdc/lproc_mdc.c +++ b/lustre/mdc/lproc_mdc.c @@ -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; } diff --git a/lustre/mdc/mdc_dev.c b/lustre/mdc/mdc_dev.c index 20298b3..8e5620f 100644 --- a/lustre/mdc/mdc_dev.c +++ b/lustre/mdc/mdc_dev.c @@ -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; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index f823075..3bcdd7a 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -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); diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index bd55e71..f7f8e3a 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -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; } diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index 543f772..93b708b 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -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; -- 1.8.3.1