Re: kernel BUG at drivers/block/cciss.c:1260! (with recent linux-2.6 tree)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Vasquez <andrew.vasquez@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, <mike.miller@...>, <k-ueda@...>, <j-nomura@...>, <tony.luck@...>
Date: Tuesday, January 29, 2008 - 5:24 pm

On Tue, Jan 29 2008, Jens Axboe wrote:

This is way cleaner.

diff --git a/block/as-iosched.c b/block/as-iosched.c
index b201d16..9603684 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -1275,9 +1275,13 @@ static void as_merged_requests(struct request_queue *q, struct request *req,
 			 * Don't copy here but swap, because when anext is
 			 * removed below, it must contain the unused context
 			 */
-			double_spin_lock(&rioc->lock, &nioc->lock, rioc < nioc);
-			swap_io_context(&rioc, &nioc);
-			double_spin_unlock(&rioc->lock, &nioc->lock, rioc < nioc);
+			if (rioc != nioc) {
+				double_spin_lock(&rioc->lock, &nioc->lock,
+								rioc < nioc);
+				swap_io_context(&rioc, &nioc);
+				double_spin_unlock(&rioc->lock, &nioc->lock,
+								rioc < nioc);
+			}
 		}
 	}
 

-- 
Jens Axboe

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: kernel BUG at drivers/block/cciss.c:1260! (with recent ..., Jens Axboe, (Tue Jan 29, 5:24 pm)
RE: kernel BUG at drivers/block/cciss.c:1260! (with recent ..., Miller, Mike (OS Dev), (Tue Jan 29, 3:03 pm)