From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Aring Date: Wed, 9 Mar 2022 10:17:39 -0500 Subject: [Cluster-devel] [PATCH dlm-tool] dlm_tool: handle dynamic length lockspace dump In-Reply-To: <20220308202119.2673632-1-aahringo@redhat.com> References: <20220308202119.2673632-1-aahringo@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, On Tue, Mar 8, 2022 at 3:21 PM Alexander Aring wrote: ... > +++ b/dlm_controld/main.c > @@ -1070,7 +1070,7 @@ static void query_node_info(int fd, char *name, int nodeid) > (char *)&node, sizeof(node)); > } > > -static void query_lockspaces(int fd, int max) > +static void query_lockspaces(int fd) > { > int ls_count = 0; > struct dlmc_lockspace *lss = NULL; > @@ -1083,12 +1083,7 @@ static void query_lockspaces(int fd, int max) > goto out; > } > > - if (ls_count > max) { > - result = -E2BIG; > - ls_count = max; > - } else { > - result = ls_count; > - } > + result = ls_count; > out: > do_reply(fd, DLMC_CMD_LOCKSPACES, NULL, result, 0, > (char *)lss, ls_count * sizeof(struct dlmc_lockspace)); > @@ -1375,7 +1370,7 @@ static void *process_queries(void *arg) > query_node_info(f, h.name, h.data); > break; > case DLMC_CMD_LOCKSPACES: > - query_lockspaces(f, h.data); > + query_lockspaces(f); > break; > case DLMC_CMD_LOCKSPACE_NODES: > query_lockspace_nodes(f, h.name, h.option, h.data); > diff --git a/dlm_tool/main.c b/dlm_tool/main.c > index 04ff40f8..f4e69649 100644 > --- a/dlm_tool/main.c > +++ b/dlm_tool/main.c > @@ -67,7 +67,6 @@ static int summarize; > char run_command[DLMC_RUN_COMMAND_LEN]; > char run_uuid[DLMC_RUN_UUID_LEN]; > > -#define MAX_LS 128 > #define MAX_NODES 128 > > /* from linux/fs/dlm/dlm_internal.h */ > @@ -91,7 +90,7 @@ char run_uuid[DLMC_RUN_UUID_LEN]; > #define DLM_MSG_PURGE 14 > > > -struct dlmc_lockspace lss[MAX_LS]; > +struct dlmc_lockspace *lss; there should be no need anymore to handle this globally, we should be able to move this pointer into the function. I will fix that as soon as I apply this patch. - Alex