Commit f2898112 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull dlm updates from David Teigland:
 "This includes several large patches to improve endian handling and
  remove sparse warnings. The code previously used in/out, in-place
  endianness conversion functions.

  Other code cleanup includes the list iterator changes.

  Finally, a long standing bug was found and fixed, caused by missed
  decrement on an lock struct ref count"

* tag 'dlm-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: (28 commits)
  dlm: use kref_put_lock in __put_lkb
  dlm: use kref_put_lock in put_rsb
  dlm: remove unnecessary error assign
  dlm: fix missing lkb refcount handling
  fs: dlm: cast resource pointer to uintptr_t
  dlm: replace usage of found with dedicated list iterator variable
  dlm: remove usage of list iterator for list_add() after the loop body
  dlm: fix pending remove if msg allocation fails
  dlm: fix wake_up() calls for pending remove
  dlm: check required context while close
  dlm: cleanup lock handling in dlm_master_lookup
  dlm: remove found label in dlm_master_lookup
  dlm: remove __user conversion warnings
  dlm: move conversion to compile time
  dlm: use __le types for dlm messages
  dlm: use __le types for rcom messages
  dlm: use __le types for dlm header
  dlm: use __le types for options header
  dlm: add __CHECKER__ for false positives
  dlm: move global to static inits
  ...
parents fea30433 8e51ec61
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
			 */

			b = ls->ls_recover_buf->rc_buf;
			left = ls->ls_recover_buf->rc_header.h_length;
			left = le16_to_cpu(ls->ls_recover_buf->rc_header.h_length);
			left -= sizeof(struct dlm_rcom);

			for (;;) {
+33 −33
Original line number Diff line number Diff line
@@ -379,15 +379,15 @@ static inline int rsb_flag(struct dlm_rsb *r, enum rsb_flags flag)
#define DLM_FIN			5

struct dlm_header {
	uint32_t		h_version;
	__le32			h_version;
	union {
		/* for DLM_MSG and DLM_RCOM */
		uint32_t	h_lockspace;
		__le32		h_lockspace;
		/* for DLM_ACK and DLM_OPTS */
		uint32_t	h_seq;
		__le32		h_seq;
	} u;
	uint32_t		h_nodeid;	/* nodeid of sender */
	uint16_t		h_length;
	__le32			h_nodeid;	/* nodeid of sender */
	__le16			h_length;
	uint8_t			h_cmd;		/* DLM_MSG, DLM_RCOM */
	uint8_t			h_pad;
};
@@ -409,24 +409,24 @@ struct dlm_header {

struct dlm_message {
	struct dlm_header	m_header;
	uint32_t		m_type;		/* DLM_MSG_ */
	uint32_t		m_nodeid;
	uint32_t		m_pid;
	uint32_t		m_lkid;		/* lkid on sender */
	uint32_t		m_remid;	/* lkid on receiver */
	uint32_t		m_parent_lkid;
	uint32_t		m_parent_remid;
	uint32_t		m_exflags;
	uint32_t		m_sbflags;
	uint32_t		m_flags;
	uint32_t		m_lvbseq;
	uint32_t		m_hash;
	int			m_status;
	int			m_grmode;
	int			m_rqmode;
	int			m_bastmode;
	int			m_asts;
	int			m_result;	/* 0 or -EXXX */
	__le32			m_type;		/* DLM_MSG_ */
	__le32			m_nodeid;
	__le32			m_pid;
	__le32			m_lkid;		/* lkid on sender */
	__le32			m_remid;	/* lkid on receiver */
	__le32			m_parent_lkid;
	__le32			m_parent_remid;
	__le32			m_exflags;
	__le32			m_sbflags;
	__le32			m_flags;
	__le32			m_lvbseq;
	__le32			m_hash;
	__le32			m_status;
	__le32			m_grmode;
	__le32			m_rqmode;
	__le32			m_bastmode;
	__le32			m_asts;
	__le32			m_result;	/* 0 or -EXXX */
	char			m_extra[];	/* name or lvb */
};

@@ -451,18 +451,18 @@ struct dlm_message {

struct dlm_rcom {
	struct dlm_header	rc_header;
	uint32_t		rc_type;	/* DLM_RCOM_ */
	int			rc_result;	/* multi-purpose */
	uint64_t		rc_id;		/* match reply with request */
	uint64_t		rc_seq;		/* sender's ls_recover_seq */
	uint64_t		rc_seq_reply;	/* remote ls_recover_seq */
	__le32			rc_type;	/* DLM_RCOM_ */
	__le32			rc_result;	/* multi-purpose */
	__le64			rc_id;		/* match reply with request */
	__le64			rc_seq;		/* sender's ls_recover_seq */
	__le64			rc_seq_reply;	/* remote ls_recover_seq */
	char			rc_buf[];
};

struct dlm_opt_header {
	uint16_t	t_type;
	uint16_t	t_length;
	uint32_t	t_pad;
	__le16		t_type;
	__le16		t_length;
	__le32		t_pad;
	/* need to be 8 byte aligned */
	char		t_value[];
};
@@ -472,8 +472,8 @@ struct dlm_opts {
	struct dlm_header	o_header;
	uint8_t			o_nextcmd;
	uint8_t			o_pad;
	uint16_t		o_optlen;
	uint32_t		o_pad2;
	__le16			o_optlen;
	__le32			o_pad2;
	char			o_opts[];
};

+348 −306

File changed.

Preview size limit exceeded, changes collapsed.

+12 −0
Original line number Diff line number Diff line
@@ -922,3 +922,15 @@ void dlm_stop_lockspaces(void)
		log_print("dlm user daemon left %d lockspaces", count);
}

void dlm_stop_lockspaces_check(void)
{
	struct dlm_ls *ls;

	spin_lock(&lslist_lock);
	list_for_each_entry(ls, &lslist, ls_list) {
		if (WARN_ON(!rwsem_is_locked(&ls->ls_in_recovery) ||
			    !dlm_locking_stopped(ls)))
			break;
	}
	spin_unlock(&lslist_lock);
}
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ struct dlm_ls *dlm_find_lockspace_local(void *id);
struct dlm_ls *dlm_find_lockspace_device(int minor);
void dlm_put_lockspace(struct dlm_ls *ls);
void dlm_stop_lockspaces(void);
void dlm_stop_lockspaces_check(void);

#endif				/* __LOCKSPACE_DOT_H__ */
Loading