Whamcloud - gitweb
LU-9325 mdt: replace simple_strtol() with kstrtol() 46/38846/3
authorJames Simmons <jsimmons@infradead.org>
Fri, 5 Jun 2020 12:55:55 +0000 (08:55 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 16 Jun 2020 02:21:44 +0000 (02:21 +0000)
Someday simple_strtol() will go away. The simple_strtol() call in
mdt_init0() is very simple so we can easily replace it with
kstrtol().

Change-Id: I37485735f0f42aa5c2c5b9fd361e4fdfa54dc8e5
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/38846
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
lustre/mdt/mdt_handler.c

index 82fc529..be9797b 100644 (file)
@@ -5599,7 +5599,10 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
                LASSERT(lsi->lsi_lmd);
                /* CMD is supported only in IAM mode */
                LASSERT(num);
-               node_id = simple_strtol(num, NULL, 10);
+               rc = kstrtol(num, 10, &node_id);
+               if (rc)
+                       RETURN(rc);
+
                obd->u.obt.obt_magic = OBT_MAGIC;
                if (lsi->lsi_lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
                        m->mdt_skip_lfsck = 1;