fs: dlm: don't use RCOM_NAMES for version detection
authorAlexander Aring <aahringo@redhat.com>
Tue, 1 Aug 2023 18:09:50 +0000 (14:09 -0400)
committerDavid Teigland <teigland@redhat.com>
Thu, 10 Aug 2023 15:33:03 +0000 (10:33 -0500)
Currently RCOM_STATUS and RCOM_NAMES inclusive their replies are being
used to determine the DLM version. The RCOM_NAMES messages are triggered
in DLM recovery when calling dlm_recover_directory() only. At this time
the DLM version need to be determined. I ran some tests and did not
expirenced some issues. When the DLM version detection was developed
probably I run once in a case of RCOM_NAMES and the version was not
detected yet. However it seems to be not necessary.

For backwards compatibility we still need to accept RCOM_NAMES messages
which are not protected regarding the DLM message reliability layer aka
stateless message. This patch changes that RCOM_NAMES we are sending out
after this patch are not stateless anymore.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/rcom.c

index 6ab0291..3b734ae 100644 (file)
@@ -308,15 +308,15 @@ static void receive_sync_reply(struct dlm_ls *ls, const struct dlm_rcom *rc_in)
 int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name,
                   int last_len, uint64_t seq)
 {
+       struct dlm_mhandle *mh;
        struct dlm_rcom *rc;
-       struct dlm_msg *msg;
        int error = 0;
 
        ls->ls_recover_nodeid = nodeid;
 
 retry:
-       error = create_rcom_stateless(ls, nodeid, DLM_RCOM_NAMES, last_len,
-                                     &rc, &msg, seq);
+       error = create_rcom(ls, nodeid, DLM_RCOM_NAMES, last_len,
+                           &rc, &mh, seq);
        if (error)
                goto out;
        memcpy(rc->rc_buf, last_name, last_len);
@@ -324,7 +324,7 @@ retry:
        allow_sync_reply(ls, &rc->rc_id);
        memset(ls->ls_recover_buf, 0, DLM_MAX_SOCKET_BUFSIZE);
 
-       send_rcom_stateless(msg, rc);
+       send_rcom(mh, rc);
 
        error = dlm_wait_function(ls, &rcom_response);
        disallow_sync_reply(ls);
@@ -337,17 +337,17 @@ retry:
 static void receive_rcom_names(struct dlm_ls *ls, const struct dlm_rcom *rc_in,
                               uint64_t seq)
 {
+       struct dlm_mhandle *mh;
        struct dlm_rcom *rc;
        int error, inlen, outlen, nodeid;
-       struct dlm_msg *msg;
 
        nodeid = le32_to_cpu(rc_in->rc_header.h_nodeid);
        inlen = le16_to_cpu(rc_in->rc_header.h_length) -
                sizeof(struct dlm_rcom);
        outlen = DLM_MAX_APP_BUFSIZE - sizeof(struct dlm_rcom);
 
-       error = create_rcom_stateless(ls, nodeid, DLM_RCOM_NAMES_REPLY, outlen,
-                                     &rc, &msg, seq);
+       error = create_rcom(ls, nodeid, DLM_RCOM_NAMES_REPLY, outlen,
+                           &rc, &mh, seq);
        if (error)
                return;
        rc->rc_id = rc_in->rc_id;
@@ -355,7 +355,7 @@ static void receive_rcom_names(struct dlm_ls *ls, const struct dlm_rcom *rc_in,
 
        dlm_copy_master_names(ls, rc_in->rc_buf, inlen, rc->rc_buf, outlen,
                              nodeid);
-       send_rcom_stateless(msg, rc);
+       send_rcom(mh, rc);
 }
 
 int dlm_send_rcom_lookup(struct dlm_rsb *r, int dir_nodeid, uint64_t seq)