On Tue, Sep 27, 2011 at 7:09 PM, Dan Bassett <dbass...@oreilly.com> wrote:
> I did some more digging after finding some more debugging flags for
> start_udev and I have more information today.  After serializing udev's
> startup process, it looks like the boot process always hangs in the same
> spot.  During the processing of the persistent storage rules that ship with
> udev, the following rule is encountered:
>
> KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
>
> This results in /sbin/blkid being run for ubd0/a as such:
>
> util_run_program: '/sbin/blkid -o udev -p /dev/.tmp-block-98:0' started
>

Can you please test the attached patch?
I should trigger the BUG_ON().

There is definitely something fishy...

-- 
Thanks,
//richard
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 620f5b7..41ae18d 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -74,7 +74,7 @@ struct io_thread_req {
 	int error;
 };
 
-static inline int ubd_test_bit(__u64 bit, unsigned char *data)
+static inline int ubd_test_bit(__u64 bit, unsigned char *data, __u64 len)
 {
 	__u64 n;
 	int bits, off;
@@ -82,6 +82,10 @@ static inline int ubd_test_bit(__u64 bit, unsigned char *data)
 	bits = sizeof(data[0]) * 8;
 	n = bit / bits;
 	off = bit % bits;
+
+	if(len)
+		BUG_ON(n >= len);
+
 	return (data[n] & (1 << off)) != 0;
 }
 
@@ -1147,7 +1151,7 @@ static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask,
 	for(i = 0; i < length >> 9; i++){
 		if(cow_mask != NULL)
 			ubd_set_bit(i, (unsigned char *) cow_mask);
-		if(ubd_test_bit(sector + i, (unsigned char *) bitmap))
+		if(ubd_test_bit(sector + i, (unsigned char *) bitmap, bitmap_len))
 			continue;
 
 		update_bitmap = 1;
@@ -1186,7 +1190,7 @@ static void cowify_req(struct io_thread_req *req, unsigned long *bitmap,
 
 	if(req->op == UBD_READ) {
 		for(i = 0; i < req->length >> 9; i++){
-			if(ubd_test_bit(sector + i, (unsigned char *) bitmap))
+			if(ubd_test_bit(sector + i, (unsigned char *) bitmap, bitmap_len))
 				ubd_set_bit(i, (unsigned char *)
 					    &req->sector_mask);
 		}
@@ -1358,11 +1362,10 @@ static void do_io(struct io_thread_req *req)
 	nsectors = req->length / req->sectorsize;
 	start = 0;
 	do {
-		bit = ubd_test_bit(start, (unsigned char *) &req->sector_mask);
+		bit = ubd_test_bit(start, (unsigned char *) &req->sector_mask, 0);
 		end = start;
-		while((end < nsectors) &&
-		      (ubd_test_bit(end, (unsigned char *)
-				    &req->sector_mask) == bit))
+		while((end < nsectors) && (ubd_test_bit(end,
+			(unsigned char *)&req->sector_mask, 0) == bit))
 			end++;
 
 		off = req->offset + req->offsets[bit] +
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to