The following commit has been merged in the master branch:
commit c7ae54a0e1873a375285ac7bff317ce81f86e049
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sun Sep 12 21:35:20 2010 +0000
batman-adv: checkpatch cleanup of comments
checkpatch now detects the start of a comment and warns about usage of
multiple spaces at the beginning of a line. We have to replace the ' '
in multiple lines comments by ' * ' to fix it.
Checkpatch also wants a comment after a definition of a spinlock_t which
describes what it protects. It is currently not possible to add it
before the actual struct which includes the spinlock.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/packet.h b/packet.h
index 87e652e..b49fdf7 100644
--- a/packet.h
+++ b/packet.h
@@ -81,7 +81,7 @@ struct icmp_packet {
#define BAT_RR_LEN 16
/* icmp_packet_rr must start with all fields from imcp_packet
- as this is assumed by code that handles ICMP packets */
+ * as this is assumed by code that handles ICMP packets */
struct icmp_packet_rr {
uint8_t packet_type;
uint8_t version; /* batman version field */
diff --git a/types.h b/types.h
index 1e736fb..e7b53a4 100644
--- a/types.h
+++ b/types.h
@@ -118,6 +118,7 @@ struct neigh_node {
struct batman_if *if_incoming;
};
+
struct bat_priv {
atomic_t mesh_state;
struct net_device_stats stats;
@@ -145,14 +146,14 @@ struct bat_priv {
struct hashtable_t *hna_local_hash;
struct hashtable_t *hna_global_hash;
struct hashtable_t *vis_hash;
- spinlock_t orig_hash_lock;
- spinlock_t forw_bat_list_lock;
- spinlock_t forw_bcast_list_lock;
- spinlock_t hna_lhash_lock;
- spinlock_t hna_ghash_lock;
- spinlock_t gw_list_lock;
- spinlock_t vis_hash_lock;
- spinlock_t vis_list_lock;
+ spinlock_t orig_hash_lock; /* protects orig_hash */
+ spinlock_t forw_bat_list_lock; /* protects forw_bat_list */
+ spinlock_t forw_bcast_list_lock; /* protects */
+ spinlock_t hna_lhash_lock; /* protects hna_local_hash */
+ spinlock_t hna_ghash_lock; /* protects hna_global_hash */
+ spinlock_t gw_list_lock; /* protects gw_list */
+ spinlock_t vis_hash_lock; /* protects vis_hash */
+ spinlock_t vis_list_lock; /* protects vis_info::recv_list */
int16_t num_local_hna;
atomic_t hna_local_changed;
struct delayed_work hna_work;
@@ -166,7 +167,7 @@ struct socket_client {
struct list_head queue_list;
unsigned int queue_len;
unsigned char index;
- spinlock_t lock;
+ spinlock_t lock; /* protects queue_list, queue_len, index */
wait_queue_head_t queue_wait;
struct bat_priv *bat_priv;
};
@@ -218,7 +219,7 @@ struct debug_log {
char log_buff[LOG_BUF_LEN];
unsigned long log_start;
unsigned long log_end;
- spinlock_t lock;
+ spinlock_t lock; /* protects log_buff, log_start and log_end */
wait_queue_head_t queue_wait;
};
diff --git a/vis.c b/vis.c
index 6de5c76..ddfdcd8 100644
--- a/vis.c
+++ b/vis.c
@@ -34,14 +34,14 @@
#define smallest_signed_int(x) (1u << (7u + 8u * (sizeof(x) - 1u)))
/* Checks if a sequence number x is a predecessor/successor of y.
- they handle overflows/underflows and can correctly check for a
- predecessor/successor unless the variable sequence number has grown by
- more then 2**(bitwidth(x)-1)-1.
- This means that for a uint8_t with the maximum value 255, it would think:
- * when adding nothing - it is neither a predecessor nor a successor
- * before adding more than 127 to the starting value - it is a predecessor,
- * when adding 128 - it is neither a predecessor nor a successor,
- * after adding more than 127 to the starting value - it is a successor */
+ * they handle overflows/underflows and can correctly check for a
+ * predecessor/successor unless the variable sequence number has grown by
+ * more then 2**(bitwidth(x)-1)-1.
+ * This means that for a uint8_t with the maximum value 255, it would think:
+ * - when adding nothing - it is neither a predecessor nor a successor
+ * - before adding more than 127 to the starting value - it is a predecessor,
+ * - when adding 128 - it is neither a predecessor nor a successor,
+ * - after adding more than 127 to the starting value - it is a successor */
#define seq_before(x, y) ({typeof(x) _dummy = (x - y); \
_dummy > smallest_signed_int(_dummy); })
#define seq_after(x, y) seq_before(y, x)
--
batman-adv
The following commit has been merged in the next branch:
commit 2bb3ae213d0ee251273622ee0720efc3692d1fd4
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sun Sep 12 21:27:21 2010 +0000
batman-adv: Unlock on failure during fragmentation rx
When we detect a failure in create_frag_buffer we must drop the packet
and unlock the orig_has which was locked before.
69d187ffb8e22024a87d8457e5dcb10e297108e9 forgot that and created a
potential deadlock of the complete system.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/routing.c b/routing.c
index 23a12cd..a07e0e0 100644
--- a/routing.c
+++ b/routing.c
@@ -1233,9 +1233,11 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if)
orig_node->last_frag_packet = jiffies;
- if (list_empty(&orig_node->frag_list)) {
- if (create_frag_buffer(&orig_node->frag_list))
- return NET_RX_DROP;
+ if (list_empty(&orig_node->frag_list) &&
+ create_frag_buffer(&orig_node->frag_list)) {
+ spin_unlock_irqrestore(&bat_priv->orig_hash_lock,
+ flags);
+ return NET_RX_DROP;
}
tmp_frag_entry =
--
batman-adv
The following commit has been merged in the master branch:
commit bcf914f2d21ac9cad80ef8e7763c4757ec0b806c
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sun Sep 12 21:27:21 2010 +0000
batman-adv: Unlock on failure during fragmentation rx
When we detect a failure in create_frag_buffer we must drop the packet
and unlock the orig_has which was locked before.
69d187ffb8e22024a87d8457e5dcb10e297108e9 forgot that and created a
potential deadlock of the complete system.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/routing.c b/routing.c
index e09a231..603a932 100644
--- a/routing.c
+++ b/routing.c
@@ -1244,9 +1244,11 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if)
orig_node->last_frag_packet = jiffies;
- if (list_empty(&orig_node->frag_list)) {
- if (create_frag_buffer(&orig_node->frag_list))
- return NET_RX_DROP;
+ if (list_empty(&orig_node->frag_list) &&
+ create_frag_buffer(&orig_node->frag_list)) {
+ spin_unlock_irqrestore(&bat_priv->orig_hash_lock,
+ flags);
+ return NET_RX_DROP;
}
tmp_frag_entry =
--
batman-adv
The tag, GregKH-20100912 has been updated
to 10aead75b0ba9e53d872d4f24012c17c405a9433 (commit)
from 556fac794a2a8f95030a6e0892d2329bf83b258b
- Shortlog ------------------------------------------------------------
commit 10aead75b0ba9e53d872d4f24012c17c405a9433
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sun Sep 12 22:51:04 2010 +0200
Staging: batman-adv: Unlock on failure during fragmentation rx
When we detect a failure in create_frag_buffer we must drop the packet
and unlock the orig_has which was locked before.
69d187ffb8e22024a87d8457e5dcb10e297108e9 forgot that and created a
potential deadlock of the complete system.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
-----------------------------------------------------------------------
--
linux integration
The following commit has been merged in the linux branch:
commit 10aead75b0ba9e53d872d4f24012c17c405a9433
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sun Sep 12 22:51:04 2010 +0200
Staging: batman-adv: Unlock on failure during fragmentation rx
When we detect a failure in create_frag_buffer we must drop the packet
and unlock the orig_has which was locked before.
69d187ffb8e22024a87d8457e5dcb10e297108e9 forgot that and created a
potential deadlock of the complete system.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
diff --git a/drivers/staging/batman-adv/routing.c b/drivers/staging/batman-adv/routing.c
index e545260..2cf8cf9 100644
--- a/drivers/staging/batman-adv/routing.c
+++ b/drivers/staging/batman-adv/routing.c
@@ -1232,9 +1232,11 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if)
orig_node->last_frag_packet = jiffies;
- if (list_empty(&orig_node->frag_list)) {
- if (create_frag_buffer(&orig_node->frag_list))
- return NET_RX_DROP;
+ if (list_empty(&orig_node->frag_list) &&
+ create_frag_buffer(&orig_node->frag_list)) {
+ spin_unlock_irqrestore(&bat_priv->orig_hash_lock,
+ flags);
+ return NET_RX_DROP;
}
tmp_frag_entry =
--
linux integration
The tag, GregKH-20100912 has been created
at 556fac794a2a8f95030a6e0892d2329bf83b258b (commit)
- Shortlog ------------------------------------------------------------
commit 556fac794a2a8f95030a6e0892d2329bf83b258b
Merge: 6a10cd9 69d187f
Author: Sven Eckelmann <sven.eckelmann(a)gmx.de>
Date: Sun Sep 12 22:26:10 2010 +0200
Merge remote branch 'origin/next' into linux
-----------------------------------------------------------------------
--
linux integration