From: James Simmons Date: Fri, 5 Jun 2020 12:55:55 +0000 (-0400) Subject: LU-9325 mdt: replace simple_strtol() with kstrtol() X-Git-Tag: 2.13.55~136 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=4115148e4ac5ccb3620a9f8d3e48da0a712943c5;hp=986fe589f9727d52cfa2350ffbaeea0cae94f3d5 LU-9325 mdt: replace simple_strtol() with kstrtol() 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 Reviewed-on: https://review.whamcloud.com/38846 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Mike Pershin --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 82fc529..be9797b 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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;