Whamcloud - gitweb
LU-9104 obd: Ignore unknown config param while mounting 68/25368/15
authorRahul Deshmkuh <rahul.deshmukh@seagate.com>
Mon, 8 May 2017 17:03:41 +0000 (22:33 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Jul 2017 03:29:46 +0000 (03:29 +0000)
class_process_proc_param() returns positive value when it encounters
unknown parameters in order to have the below levels process them.
At the very bottom layer the positive value returned by
class_process_proc_param() needs to be dropped.osd_process_config()
missed that, which resulted in target mount failure.

Make sure that osd_process_config() does not return positive value
returned by class_process_proc_param().

Test case has been added to check processing of unknown config
parameters.

Test-Parameters: testlist=conf-sanity
Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Signed-off-by: Rahul Deshmukh <rahul.deshmukh@seagate.com>
Seagate-bug-id: MRP-4162
Change-Id: I068b8f2aee4cee69629efc83745d7cb88aea268c
Reviewed-on: https://review.whamcloud.com/25368
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_handler.c
lustre/tests/conf-sanity.sh [changed mode: 0755->0644]

index 4e98210..aabc3e6 100644 (file)
@@ -7209,10 +7209,13 @@ static int osd_process_config(const struct lu_env *env,
                LASSERT(&o->od_dt_dev);
                rc = class_process_proc_param(PARAM_OSD, lprocfs_osd_obd_vars,
                                              cfg, &o->od_dt_dev);
-               if (rc > 0 || rc == -ENOSYS)
+               if (rc > 0 || rc == -ENOSYS) {
                        rc = class_process_proc_param(PARAM_OST,
                                                      lprocfs_osd_obd_vars,
                                                      cfg, &o->od_dt_dev);
+                       if (rc > 0)
+                               rc = 0;
+               }
                break;
        default:
                rc = -ENOSYS;
index bcb8705..fe41089 100644 (file)
@@ -1294,10 +1294,13 @@ static int osd_process_config(const struct lu_env *env,
                LASSERT(&o->od_dt_dev);
                rc = class_process_proc_param(PARAM_OSD, lprocfs_osd_obd_vars,
                                              cfg, &o->od_dt_dev);
-               if (rc > 0 || rc == -ENOSYS)
+               if (rc > 0 || rc == -ENOSYS) {
                        rc = class_process_proc_param(PARAM_OST,
                                                      lprocfs_osd_obd_vars,
                                                      cfg, &o->od_dt_dev);
+                       if (rc > 0)
+                               rc = 0;
+               }
                break;
        }
        default:
old mode 100755 (executable)
new mode 100644 (file)
index 4bca875..d3a515a
@@ -7450,9 +7450,30 @@ test_105() {
                error_and_umount "file not created on rw bind mnt pt"
        umount $TMP/$tdir || error "umount of bind mnt pt failed"
        rmdir $TMP/$tdir
+       cleanup || error "cleanup failed with $?"
 }
 run_test 105 "check file creation for ro and rw bind mnt pt"
 
+test_107() {
+       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.50) ]] ||
+               { skip "Need MDS version > 2.10.50"; return; }
+
+       start_mgsmds || error "start_mgsmds failed"
+       start_ost || error "unable to start OST"
+
+       # add unknown configuration parameter.
+       local PARAM="$FSNAME-OST0000.ost.unknown_param=50"
+       do_facet mgs "$LCTL conf_param $PARAM"
+       cleanup_nocli || error "cleanup_nocli failed with $?"
+       load_modules
+
+       # unknown param should be ignored while mounting.
+       start_ost || error "unable to start OST after unknown param set"
+
+       cleanup || error "cleanup failed with $?"
+}
+run_test 107 "Unknown config param should not fail target mounting"
+
 if ! combined_mgs_mds ; then
        stop mgs
 fi