Skip to contentSkip to conversation

dlm_controld: set posix_lock flags to zero

PATCH New Alexander Aring 2 participants 3 messages Mar 21, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dlm_controld: set posix_lock flags to zero

This patch sets another flags variable to zero which is a leftover of commit 0834ed4b ("dlm_controld: initialize waiter->flags").

---
 dlm_controld/plock.c | 1 +
 1 file changed, 1 insertion(+)
dlm_controld/plock.c +1 -0
index ad9b0f27..7f632888 100644
@@ -1956,6 +1956,7 @@ void receive_plocks_data(struct lockspace *ls, struct dlm_header *hd, int len)
 			po->pid		= le32_to_cpu(pp->pid);
 			po->nodeid	= le32_to_cpu(pp->nodeid);
 			po->ex		= pp->ex;
+			po->flags	= 0;
 			list_add_tail(&po->list, &r->locks);
 		} else {
 			w = malloc(sizeof(struct lock_waiter));
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 dlm_controld: set posix_lock flags to zero

Quoted 11 lines · On Tue, Mar 21, 2023 at 2:17?PM Alexander Aring <[email protected]> wrote:

This patch sets another flags variable to zero which is a leftover of commit 0834ed4b ("dlm_controld: initialize waiter->flags").

---
 dlm_controld/plock.c | 1 +
 1 file changed, 1 insertion(+)
dlm_controld/plock.c +0 -0
index ad9b0f27..7f632888 100644

dlm_controld/plock.c void receive_plocks_data(struct lockspace *ls, struct dlm_header *hd, int len) · line 1962

Quoted 7 lines
dlm_controld/plock.c +1 -0
@@ -1956,6 +1956,7 @@ void receive_plocks_data(struct lockspace *ls, struct dlm_header *hd, int len)
                        po->pid         = le32_to_cpu(pp->pid);
                        po->nodeid      = le32_to_cpu(pp->nodeid);
                        po->ex          = pp->ex;
+                       po->flags       = 0;
                        list_add_tail(&po->list, &r->locks);
                } else {
                        w = malloc(sizeof(struct lock_waiter));

^ And I think w->flags also isn't being initialized.

Andreas

#2 lore raw

PATCH 1/1 dlm_controld: set posix_lock flags to zero

Hi,

Quoted 8 lines · On Tue, Mar 21, 2023 at 9:34?AM Andreas Gruenbacher <[email protected]> wrote:
Quoted 6 lines · On Tue, Mar 21, 2023 at 2:17?PM Alexander Aring <[email protected]> wrote:

This patch sets another flags variable to zero which is a leftover of commit 0834ed4b ("dlm_controld: initialize waiter->flags").

---
 dlm_controld/plock.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 14 lines

dlm_controld/plock.c void receive_plocks_data(struct lockspace *ls, struct dlm_header *hd, int len) · line 1962

Quoted 12 lines
dlm_controld/plock.c +1 -0
index ad9b0f27..7f632888 100644
@@ -1956,6 +1956,7 @@ void receive_plocks_data(struct lockspace *ls, struct dlm_header *hd, int len)
                        po->pid         = le32_to_cpu(pp->pid);
                        po->nodeid      = le32_to_cpu(pp->nodeid);
                        po->ex          = pp->ex;
+                       po->flags       = 0;
                        list_add_tail(&po->list, &r->locks);
                } else {
                        w = malloc(sizeof(struct lock_waiter));

^ And I think w->flags also isn't being initialized.

I added it by changing your patch, but I only checked for lock_waiter... After pushing those patches I found a missing piece in posix_lock.

Meanwhile I ran cppcheck on it and it found another issue...

- Alex