Whamcloud - gitweb
LU-13252 mgs: Handle possible failure from name_create_mdt 84/37584/3
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 19 Feb 2020 22:56:28 +0000 (16:56 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 11 Mar 2020 02:19:42 +0000 (02:19 +0000)
name_create_mdt may not succeed if memory allocation fails.

Cray-bug-id: LUS-8503
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I692cfd962e39b7f41d21bcfff1d7577a722ab80d
Reviewed-on: https://review.whamcloud.com/37584
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
lustre/mgs/mgs_llog.c

index 08c2a37..726262f 100644 (file)
@@ -1594,7 +1594,9 @@ int mgs_replace_nids(const struct lu_env *env,
        }
 
        /* Process client llogs */
-       name_create(&logname, fsname, "-client");
+       rc = name_create(&logname, fsname, "-client");
+       if (rc)
+               GOTO(out, rc);
        rc = mgs_replace_nids_log(env, mgs_obd, logname, devname, nids);
        name_destroy(&logname);
        if (rc) {
@@ -1607,7 +1609,9 @@ int mgs_replace_nids(const struct lu_env *env,
        for (i = 0; i < INDEX_MAP_SIZE * 8; i++) {
                if (!test_bit(i, fsdb->fsdb_mdt_index_map))
                        continue;
-               name_create_mdt(&logname, fsname, i);
+               rc = name_create_mdt(&logname, fsname, i);
+               if (rc)
+                       GOTO(out, rc);
                rc = mgs_replace_nids_log(env, mgs_obd, logname, devname, nids);
                name_destroy(&logname);
                if (rc)