Whamcloud - gitweb
LU-15106 ofd: quiet deprecated param warning
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 14 Oct 2021 20:01:30 +0000 (14:01 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 15 Oct 2021 17:19:52 +0000 (17:19 +0000)
There are a number of obdfilter parameter files that report a
warning even when they are read, which is confusing for users
if there is a tool that is scraping all available parameters:

    # lctl get_param obdfilter.*.*
    ofd: 'obdfilter.*.read_cache_enabled' is deprecated,
         use 'osd-*.read_cache_enabled' instead
    ofd: 'obdfilter.*.readcache_max_filesize' is deprecated,
         use 'osd-*.readcache_max_filesize' instead
    ofd: 'obdfilter.*.sync_on_lock_cancel' is deprecated,
         use 'obdfilter.*.sync_lock_cancel' instead
    ofd: 'obdfilter.*.writethrough_cache_enabled' is deprecated,
         use 'osd-*.writethrough_cache_enabled' instead

It should only print a message if the parameters are actually written.
Also fix the messages to reference the correct parameter names.

Most of these parameter links were added in 2.4 with the addition of
osd-ldiskfs.  However, the deprecation warnings were only added in
2.12.53 and slated for removal in 2.15, but were not backported to
2.12 LTS, and there hasn't been an LTS release since then, so it is
better bump removal so the upcoming 2.15 LTS release includes them.

Fix the test scripts to only use the new parameter names, to avoid
spurious warning messages.  We don't test interop with 2.3 anymore.

Lustre-change: https://review.whamcloud.com/45246
Lustre-commit: TBD (from cf05bfb35f00c72f27ec36619259cc77eb56186d)

Test-Parameters: trivial
Fixes: 7df7347b7b18 ("LU-12967 ofd: restore sync_on_lock_cancel tunable")
Fixes: 493cd8088388 ("LU-8066 osd: migrate from proc to sysfs")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie548e5b6af5463959fb4774e31996097373ebbe5
Reviewed-on: https://review.whamcloud.com/45247
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/ofd/lproc_ofd.c
lustre/tests/test-framework.sh

index 5c27fa3..5155c26 100644 (file)
@@ -472,14 +472,9 @@ ofd_brw_size_seq_write(struct file *file, const char __user *buffer,
 LPROC_SEQ_FOPS(ofd_brw_size);
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
-static bool sync_on_lock_cancel_warned;
 static ssize_t sync_on_lock_cancel_show(struct kobject *kobj,
                                        struct attribute *attr, char *buf)
 {
-       if (!sync_on_lock_cancel_warned) {
-               sync_on_lock_cancel_warned = true;
-               pr_info("ofd: 'obdfilter.*.sync_on_lock_cancel' is deprecated, use 'obdfilter.*.sync_lock_cancel' instead\n");
-       }
        return sync_lock_cancel_show(kobj, attr, buf);
 }
 
@@ -487,6 +482,8 @@ static ssize_t sync_on_lock_cancel_store(struct kobject *kobj,
                                         struct attribute *attr,
                                         const char *buffer, size_t count)
 {
+       static bool sync_on_lock_cancel_warned;
+
        if (!sync_on_lock_cancel_warned) {
                sync_on_lock_cancel_warned = true;
                pr_info("ofd: 'obdfilter.*.sync_on_lock_cancel' is deprecated, use 'obdfilter.*.sync_lock_cancel' instead\n");
@@ -858,11 +855,7 @@ static ssize_t checksum_t10pi_enforce_store(struct kobject *kobj,
 }
 LUSTRE_RW_ATTR(checksum_t10pi_enforce);
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 14, 53, 0)
-static bool max_file_warned;
-static bool rd_cache_warned;
-static bool wr_cache_warned;
-
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 15, 53, 0)
 static ssize_t read_cache_enable_show(struct kobject *kobj,
                                      struct attribute *attr,
                                      char *buf)
@@ -871,11 +864,6 @@ static ssize_t read_cache_enable_show(struct kobject *kobj,
                                              obd_kset.kobj);
        struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
 
-       if (!rd_cache_warned) {
-               rd_cache_warned = true;
-               pr_info("ofd: 'obdfilter.*.read_cache_enabled' is deprecated, use 'osd-*.read_cache_enabled' instead\n");
-       }
-
        if (!ofd->ofd_read_cache_enable)
                return -EOPNOTSUPP;
 
@@ -890,10 +878,11 @@ static ssize_t read_cache_enable_store(struct kobject *kobj,
        struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+       static bool rd_cache_warned;
 
        if (!rd_cache_warned) {
                rd_cache_warned = true;
-               pr_info("ofd: 'obdfilter.*.read_cache_enabled' is deprecated, use 'osd-*.read_cache_enabled' instead\n");
+               pr_info("ofd: 'obdfilter.*.read_cache_enable' is deprecated, use 'osd-*.*.read_cache_enable' instead\n");
        }
 
        if (!ofd->ofd_read_cache_enable)
@@ -912,11 +901,6 @@ static ssize_t readcache_max_filesize_show(struct kobject *kobj,
                                              obd_kset.kobj);
        struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
 
-       if (!max_file_warned) {
-               max_file_warned = true;
-               pr_info("ofd: 'obdfilter.*.readcache_max_filesize' is deprecated, use 'osd-*.readcache_max_filesize' instead\n");
-       }
-
        if (!ofd->ofd_read_cache_max_filesize)
                return -EOPNOTSUPP;
 
@@ -931,10 +915,11 @@ static ssize_t readcache_max_filesize_store(struct kobject *kobj,
        struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+       static bool max_file_warned;
 
        if (!max_file_warned) {
                max_file_warned = true;
-               pr_info("ofd: 'obdfilter.*.readcache_max_filesize' is deprecated, use 'osd-*.readcache_max_filesize' instead\n");
+               pr_info("ofd: 'obdfilter.*.readcache_max_filesize' is deprecated, use 'osd-*.*.readcache_max_filesize' instead\n");
        }
 
        if (!ofd->ofd_read_cache_max_filesize)
@@ -954,11 +939,6 @@ static ssize_t writethrough_cache_enable_show(struct kobject *kobj,
                                              obd_kset.kobj);
        struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
 
-       if (!wr_cache_warned) {
-               wr_cache_warned = true;
-               pr_info("ofd: 'obdfilter.*.writethrough_cache_enabled' is deprecated, use 'osd-*.writethrough_cache_enabled' instead\n");
-       }
-
        if (!ofd->ofd_write_cache_enable)
                return -EOPNOTSUPP;
 
@@ -973,6 +953,12 @@ static ssize_t writethrough_cache_enable_store(struct kobject *kobj,
        struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
        struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+       static bool wr_cache_warned;
+
+       if (!wr_cache_warned) {
+               wr_cache_warned = true;
+               pr_info("ofd: 'obdfilter.*.writethrough_cache_enable' is deprecated, use 'osd-*.*.writethrough_cache_enable' instead\n");
+       }
 
        if (!ofd->ofd_write_cache_enable)
                return -EOPNOTSUPP;
@@ -1091,7 +1077,7 @@ static struct attribute *ofd_attrs[] = {
        &lustre_attr_access_log_size.attr,
        &lustre_attr_job_cleanup_interval.attr,
        &lustre_attr_checksum_t10pi_enforce.attr,
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 14, 53, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 15, 53, 0)
        &lustre_attr_read_cache_enable.attr,
        &lustre_attr_readcache_max_filesize.attr,
        &lustre_attr_writethrough_cache_enable.attr,
index 9d98a6b..40611d5 100755 (executable)
@@ -1564,8 +1564,7 @@ get_osd_param() {
        local device=${2:-$FSNAME-OST*}
        local name=$3
 
-       do_nodes $nodes "$LCTL get_param -n obdfilter.$device.$name \
-               osd-*.$device.$name 2>&1" | grep -v 'error:'
+       do_nodes $nodes "$LCTL get_param -n osd-*.$device.$name"
 }
 
 set_osd_param() {
@@ -1574,8 +1573,7 @@ set_osd_param() {
        local name=$3
        local value=$4
 
-       do_nodes $nodes "$LCTL set_param -n obdfilter.$device.$name=$value \
-               osd-*.$device.$name=$value 2>&1" | grep -v 'error:'
+       do_nodes $nodes "$LCTL set_param -n osd-*.$device.$name=$value"
 }
 
 set_debug_size () {