If the MGS is down then yaml_get_device_index() will fail to
contact the Netlink layer on the MGS server. When it fails
the bool done is still set to true which causes it to go into
a loop. The proper solution is to break on emitter failure of
any kind to the end of the function to cleanup the parser
and netlink socket.
Change-Id: Ia25000dd86fd2c5f46f5de24f9a5f391c373fea4
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55881
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
error:
if (rc == 0) {
yaml_emitter_log_error(&request, stderr);
+ yaml_emitter_delete(&request);
rc = -EINVAL;
+ goto free_reply;
}
yaml_emitter_delete(&request);
yaml_event_delete(&event);
rc = -errno;
}
- return rc;
+ goto free_reply;
}
}
}
done = (event.type == YAML_STREAM_END_EVENT);
yaml_event_delete(&event);
}
-
+free_reply:
+ yaml_parser_delete(&reply);
nl_socket_free(sk);
return rc;