We were seeing more list_add corruption panics. So, I looked for all the
places a list_for_each was used and there were two places where
list_del()'s were occuring inside of the list_for_each. This patch
changes those to the safe variant.
Light testing doesn't show it breaking anything (I wouldn't expect it
to).
Patch against main is attached.
Michael
Index: src/kernel/linux-2.6/pvfs2-kernel.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h,v
retrieving revision 1.157.8.1
diff -a -u -p -r1.157.8.1 pvfs2-kernel.h
--- src/kernel/linux-2.6/pvfs2-kernel.h 14 Aug 2009 21:13:38 -0000
1.157.8.1
+++ src/kernel/linux-2.6/pvfs2-kernel.h 15 Sep 2010 13:19:23 -0000
@@ -977,10 +977,11 @@ do {
#define remove_op_from_request_list(op) \
do { \
struct list_head *tmp = NULL; \
+ struct list_head *tmp_safe = NULL; \
pvfs2_kernel_op_t *tmp_op = NULL; \
\
spin_lock(&pvfs2_request_list_lock); \
- list_for_each(tmp, &pvfs2_request_list) { \
+ list_for_each_safe(tmp, tmp_safe, &pvfs2_request_list) { \
tmp_op = list_entry(tmp, pvfs2_kernel_op_t, list); \
if (tmp_op && (tmp_op == op)) { \
list_del(&tmp_op->list); \
@@ -1080,10 +1081,11 @@ do {
#define remove_pvfs2_sb(sb) \
do { \
struct list_head *tmp = NULL; \
+ struct list_head *tmp_safe = NULL; \
pvfs2_sb_info_t *pvfs2_sb = NULL; \
\
spin_lock(&pvfs2_superblocks_lock); \
- list_for_each(tmp, &pvfs2_superblocks) { \
+ list_for_each_safe(tmp, tmp_safe, &pvfs2_superblocks) { \
pvfs2_sb = list_entry(tmp, pvfs2_sb_info_t, list); \
if (pvfs2_sb && (pvfs2_sb->sb == sb)) { \
gossip_debug(GOSSIP_SUPER_DEBUG, "Removing SB %p from pvfs2
superblocks\n", \
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers