Whamcloud - gitweb
LU-17592 build: kernel 6.8 removed strlcpy()
[fs/lustre-release.git] / lustre / ptlrpc / sec_config.c
index be7965b..a818717 100644 (file)
@@ -99,7 +99,7 @@ int sptlrpc_parse_flavor(const char *str, struct sptlrpc_flavor *flvr)
                return 0;
        }
 
-       strlcpy(buf, str, sizeof(buf));
+       strscpy(buf, str, sizeof(buf));
 
        bulk = strchr(buf, '-');
        if (bulk)
@@ -533,7 +533,7 @@ struct sptlrpc_conf_tgt *sptlrpc_conf_get_tgt(struct sptlrpc_conf *conf,
 
        OBD_ALLOC_PTR(conf_tgt);
        if (conf_tgt) {
-               strlcpy(conf_tgt->sct_name, name, sizeof(conf_tgt->sct_name));
+               strscpy(conf_tgt->sct_name, name, sizeof(conf_tgt->sct_name));
                sptlrpc_rule_set_init(&conf_tgt->sct_rset);
                list_add(&conf_tgt->sct_list, &conf->sc_tgts);
        }
@@ -558,9 +558,7 @@ struct sptlrpc_conf *sptlrpc_conf_get(const char *fsname,
        OBD_ALLOC_PTR(conf);
        if (conf == NULL)
                return NULL;
-
-       if (strlcpy(conf->sc_fsname, fsname, sizeof(conf->sc_fsname)) >=
-           sizeof(conf->sc_fsname)) {
+       if (strscpy(conf->sc_fsname, fsname, sizeof(conf->sc_fsname)) < 0) {
                OBD_FREE_PTR(conf);
                return NULL;
        }
@@ -674,7 +672,7 @@ int sptlrpc_process_config(struct lustre_cfg *lcfg)
         *      is a actual filesystem.
         */
        if (server_name2fsname(target, fsname, NULL))
-               strlcpy(fsname, target, sizeof(fsname));
+               strscpy(fsname, target, sizeof(fsname));
 
        rc = sptlrpc_parse_rule(param, &rule);
        if (rc)