Fixes for the deferqueue_add() function (v2)
PATCH 1/1 Fixes for the deferqueue_add() function (v2)
I'm not sure how the deferqueue would (or has ever) worked without these modifications, but I had to make them in order to use it :)
Changes (v2):
- Remove unnecessary initialization of the new list item
--- kernel/deferqueue.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/deferqueue.c +2 -2
@@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size, {struct deferqueue_entry *dq; - dq =kmalloc (sizeof (dq) + size,GFP_KERNEL ); + dq =kmalloc (sizeof (*dq) + size,GFP_KERNEL );if (!dq)return -ENOMEM ;
@@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,pr_debug ("%s: adding work %p func %p dtor %p\n" , __func__, dq, func, dtor);spin_lock (&head->lock); -list_add_tail (&head->list, &dq->list); +list_add_tail (&dq->list, &head->list);spin_unlock (&head->lock);return 0 ; }
Signature · 1 line
1.6.0.4
A message that is not in the archive (sent off-list or not yet received): 1245435505-24842-1-git-send-email-danms-r/[email protected]
Serge E. Hallyn
Reviewed-byQuoted 5 lines · Dan Smith
I'm not sure how the deferqueue would (or has ever) worked without these modifications, but I had to make them in order to use it :)
Changes (v2):
- Remove unnecessary initialization of the new list item
thanks,
-serge
Quoted 35 lines
Signed-off-by Dan Smith <danms-r/[email protected]>--- kernel/deferqueue.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)kernel/deferqueue.c +2
-2@@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size, {struct deferqueue_entry *dq; - dq =kmalloc (sizeof (dq) + size,GFP_KERNEL ); + dq =kmalloc (sizeof (*dq) + size,GFP_KERNEL );if (!dq)return -ENOMEM ;@@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,pr_debug ("%s: adding work %p func %p dtor %p\n" , __func__, dq, func, dtor);spin_lock (&head->lock); -list_add_tail (&head->list, &dq->list); +list_add_tail (&dq->list, &head->list);spin_unlock (&head->lock);return 0 ; }Signature · 6 lines
1.6.0.4 _______________________________________________ Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org https://lists.linux-foundation.org/mailman/listinfo/containers
Amerigo Wang
Reviewed-byQuoted 8 lines · Dan Smith
I'm not sure how the deferqueue would (or has ever) worked without these modifications, but I had to make them in order to use it :)
Changes (v2):
- Remove unnecessary initialization of the new list itemSigned-off-by Dan Smith <danms-r/[email protected]>
Good catch!!
Quoted 33 lines
---
kernel/deferqueue.c| 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)kernel/deferqueue.c +2
-2@@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size, {struct deferqueue_entry *dq; - dq =kmalloc (sizeof (dq) + size,GFP_KERNEL ); + dq =kmalloc (sizeof (*dq) + size,GFP_KERNEL );if (!dq)return -ENOMEM ;@@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,pr_debug ("%s: adding work %p func %p dtor %p\n" , __func__, dq, func, dtor);spin_lock (&head->lock); -list_add_tail (&head->list, &dq->list); +list_add_tail (&dq->list, &head->list);spin_unlock (&head->lock);return 0 ; }Signature · 6 lines
1.6.0.4 _______________________________________________ Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org https://lists.linux-foundation.org/mailman/listinfo/containers
Quoted 8 lines · Dan Smith
I'm not sure how the deferqueue would (or has ever) worked without these modifications, but I had to make them in order to use it :)
Changes (v2):
- Remove unnecessary initialization of the new list itemSigned-off-by Dan Smith <danms-r/[email protected]>
Of course... added.
Thanks,
Oren.
Quoted 26 lines
--- kernel/deferqueue.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)kernel/deferqueue.c +2
-2@@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size, {struct deferqueue_entry *dq; - dq =kmalloc (sizeof (dq) + size,GFP_KERNEL ); + dq =kmalloc (sizeof (*dq) + size,GFP_KERNEL );if (!dq)return -ENOMEM ;@@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,pr_debug ("%s: adding work %p func %p dtor %p\n" , __func__, dq, func, dtor);spin_lock (&head->lock); -list_add_tail (&head->list, &dq->list); +list_add_tail (&dq->list, &head->list);spin_unlock (&head->lock);return 0 ; }