public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6] ibmveth bug fixes 2/4
@ 2004-08-10 18:06 Santiago Leon
  2004-08-10 18:28 ` Dave Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Santiago Leon @ 2004-08-10 18:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel list

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

Andrew,

This patch fixes a race condition that would panic the kernel when 
replenishing a buffer pool.  Please apply.

Signed-off-by: Santiago Leon <santil@us.ibm.com>

-- 
Santiago A. Leon
Power Linux Development
IBM Linux Technology Center

[-- Attachment #2: ibmveth_race.patch --]
[-- Type: text/plain, Size: 946 bytes --]

===== drivers/net/ibmveth.c 1.14 vs edited =====
--- 1.14/drivers/net/ibmveth.c	Tue Aug 10 11:56:29 2004
+++ edited/drivers/net/ibmveth.c	Tue Aug 10 11:57:09 2004
@@ -219,6 +219,7 @@
 
 		dma_addr = vio_map_single(adapter->vdev, skb->data, pool->buff_size, DMA_FROM_DEVICE);
 
+               pool->free_map[free_index] = 0xffff;
 		pool->dma_addr[index] = dma_addr;
 		pool->skbuff[index] = skb;
 
@@ -233,6 +234,7 @@
 		lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
 		    
 		if(lpar_rc != H_Success) {
+                       pool->free_map[free_index] = index;
 			pool->skbuff[index] = NULL;
 			pool->consumer_index--;
 			vio_unmap_single(adapter->vdev, pool->dma_addr[index], pool->buff_size, DMA_FROM_DEVICE);
@@ -240,7 +242,6 @@
 			adapter->replenish_add_buff_failure++;
 			break;
 		} else {
-			pool->free_map[free_index] = 0xffff;
 			buffers_added++;
 			adapter->replenish_add_buff_success++;
 		}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-08-10 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-10 18:06 [PATCH 2.6] ibmveth bug fixes 2/4 Santiago Leon
2004-08-10 18:28 ` Dave Hansen
2004-08-10 19:02   ` Santiago Leon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox