Skip to content

Commit f289811

Browse files
committed
Merge tag 'dlm-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
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 ...
2 parents fea3043 + 8e51ec6 commit f289811

File tree

15 files changed

+633
-669
lines changed

15 files changed

+633
-669
lines changed

fs/dlm/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
101101
*/
102102

103103
b = ls->ls_recover_buf->rc_buf;
104-
left = ls->ls_recover_buf->rc_header.h_length;
104+
left = le16_to_cpu(ls->ls_recover_buf->rc_header.h_length);
105105
left -= sizeof(struct dlm_rcom);
106106

107107
for (;;) {

fs/dlm/dlm_internal.h

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,15 @@ static inline int rsb_flag(struct dlm_rsb *r, enum rsb_flags flag)
379379
#define DLM_FIN 5
380380

381381
struct dlm_header {
382-
uint32_t h_version;
382+
__le32 h_version;
383383
union {
384384
/* for DLM_MSG and DLM_RCOM */
385-
uint32_t h_lockspace;
385+
__le32 h_lockspace;
386386
/* for DLM_ACK and DLM_OPTS */
387-
uint32_t h_seq;
387+
__le32 h_seq;
388388
} u;
389-
uint32_t h_nodeid; /* nodeid of sender */
390-
uint16_t h_length;
389+
__le32 h_nodeid; /* nodeid of sender */
390+
__le16 h_length;
391391
uint8_t h_cmd; /* DLM_MSG, DLM_RCOM */
392392
uint8_t h_pad;
393393
};
@@ -409,24 +409,24 @@ struct dlm_header {
409409

410410
struct dlm_message {
411411
struct dlm_header m_header;
412-
uint32_t m_type; /* DLM_MSG_ */
413-
uint32_t m_nodeid;
414-
uint32_t m_pid;
415-
uint32_t m_lkid; /* lkid on sender */
416-
uint32_t m_remid; /* lkid on receiver */
417-
uint32_t m_parent_lkid;
418-
uint32_t m_parent_remid;
419-
uint32_t m_exflags;
420-
uint32_t m_sbflags;
421-
uint32_t m_flags;
422-
uint32_t m_lvbseq;
423-
uint32_t m_hash;
424-
int m_status;
425-
int m_grmode;
426-
int m_rqmode;
427-
int m_bastmode;
428-
int m_asts;
429-
int m_result; /* 0 or -EXXX */
412+
__le32 m_type; /* DLM_MSG_ */
413+
__le32 m_nodeid;
414+
__le32 m_pid;
415+
__le32 m_lkid; /* lkid on sender */
416+
__le32 m_remid; /* lkid on receiver */
417+
__le32 m_parent_lkid;
418+
__le32 m_parent_remid;
419+
__le32 m_exflags;
420+
__le32 m_sbflags;
421+
__le32 m_flags;
422+
__le32 m_lvbseq;
423+
__le32 m_hash;
424+
__le32 m_status;
425+
__le32 m_grmode;
426+
__le32 m_rqmode;
427+
__le32 m_bastmode;
428+
__le32 m_asts;
429+
__le32 m_result; /* 0 or -EXXX */
430430
char m_extra[]; /* name or lvb */
431431
};
432432

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

452452
struct dlm_rcom {
453453
struct dlm_header rc_header;
454-
uint32_t rc_type; /* DLM_RCOM_ */
455-
int rc_result; /* multi-purpose */
456-
uint64_t rc_id; /* match reply with request */
457-
uint64_t rc_seq; /* sender's ls_recover_seq */
458-
uint64_t rc_seq_reply; /* remote ls_recover_seq */
454+
__le32 rc_type; /* DLM_RCOM_ */
455+
__le32 rc_result; /* multi-purpose */
456+
__le64 rc_id; /* match reply with request */
457+
__le64 rc_seq; /* sender's ls_recover_seq */
458+
__le64 rc_seq_reply; /* remote ls_recover_seq */
459459
char rc_buf[];
460460
};
461461

462462
struct dlm_opt_header {
463-
uint16_t t_type;
464-
uint16_t t_length;
465-
uint32_t t_pad;
463+
__le16 t_type;
464+
__le16 t_length;
465+
__le32 t_pad;
466466
/* need to be 8 byte aligned */
467467
char t_value[];
468468
};
@@ -472,8 +472,8 @@ struct dlm_opts {
472472
struct dlm_header o_header;
473473
uint8_t o_nextcmd;
474474
uint8_t o_pad;
475-
uint16_t o_optlen;
476-
uint32_t o_pad2;
475+
__le16 o_optlen;
476+
__le32 o_pad2;
477477
char o_opts[];
478478
};
479479

0 commit comments

Comments
 (0)