Skip to content

Commit

Permalink
fs: dlm: don't use RCOM_NAMES for version detection
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
Alexander Aring authored and teigland committed Aug 10, 2023
1 parent 63e711b commit a3d85fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions fs/dlm/rcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,23 @@ 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);

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);
Expand All @@ -337,25 +337,25 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name,
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;
rc->rc_seq_reply = rc_in->rc_seq;

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)
Expand Down

0 comments on commit a3d85fc

Please sign in to comment.