With the move to sysfs for lod every lctl conf_param option will
send out a udev event. Replace class_process_proc_param() with
class_modify_config() so sysfs attributes can be set directly.
This patch exposed an error in stripecount_store() which doesn't
allow setting stripe count to -1 which is wrong.
Change-Id: I4eee8b2b0f3661ac69242ff7a1da6346153a56e8
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/33180
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
case LCFG_PARAM: {
struct obd_device *obd;
case LCFG_PARAM: {
struct obd_device *obd;
char *param;
/* Check if it is activate/deactivate mdc
char *param;
/* Check if it is activate/deactivate mdc
if (strstr(param, PARAM_LOD) != NULL)
if (strstr(param, PARAM_LOD) != NULL)
- rc = class_process_proc_param(PARAM_LOD, obd->obd_vars,
- lcfg, obd);
+ count = class_modify_config(lcfg, PARAM_LOD,
+ &lod->lod_dt_dev.dd_kobj);
- rc = class_process_proc_param(PARAM_LOV, obd->obd_vars,
- lcfg, obd);
- if (rc > 0)
- rc = 0;
-
+ count = class_modify_config(lcfg, PARAM_LOV,
+ &lod->lod_dt_dev.dd_kobj);
+ rc = count > 0 ? 0 : count;
GOTO(out, rc);
}
case LCFG_PRE_CLEANUP: {
GOTO(out, rc);
}
case LCFG_PRE_CLEANUP: {
struct dt_device *dt = container_of(kobj, struct dt_device,
dd_kobj);
struct lod_device *lod = dt2lod_dev(dt);
struct dt_device *dt = container_of(kobj, struct dt_device,
dd_kobj);
struct lod_device *lod = dt2lod_dev(dt);
- rc = kstrtouint(buffer, 0, &stripe_count);
+ rc = kstrtoint(buffer, 0, &stripe_count);
+ if (stripe_count < -1)
+ return -ERANGE;
+
lod_fix_desc_stripe_count(&stripe_count);
lod->lod_desc.ld_default_stripe_count = stripe_count;
lod_fix_desc_stripe_count(&stripe_count);
lod->lod_desc.ld_default_stripe_count = stripe_count;