Whamcloud - gitweb
LU-7236 ptlrpc: idle connections can disconnect
[fs/lustre-release.git] / lustre / lov / lov_dev.c
index b9c7b0c..acd868a 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2016, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -447,7 +447,7 @@ static int lov_process_config(const struct lu_env *env,
        int cmd;
        int rc;
        int gen;
-       __u32 index;
+       u32 index;
 
        obd_getref(obd);
 
@@ -479,8 +479,9 @@ static int lov_process_config(const struct lu_env *env,
 
                obd_str2uuid(&tgt_uuid, lustre_cfg_buf(cfg, 1));
 
-               if (sscanf(lustre_cfg_buf(cfg, 2), "%d", &index) != 1)
-                       GOTO(out, rc = -EINVAL);
+               rc = kstrtou32(lustre_cfg_buf(cfg, 2), 10, &index);
+               if (rc)
+                       GOTO(out, rc);
 
                mdc = class_find_client_obd(&tgt_uuid, LUSTRE_MDC_NAME,
                                            &obd->obd_uuid);