mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hugang <gang_hu@soul.com.cn>
To: Jeff Dike <jdike@karaya.com>
Cc: glonnon@ridgerun.com, pavel@suse.cz, seasons@fornax.hu,
	linux-kernel@vger.kernel.org
Subject: Re: [PATH] Port software to UML.
Date: Mon, 6 May 2002 10:50:25 +0800	[thread overview]
Message-ID: <20020506105025.217b96e6.gang_hu@soul.com.cn> (raw)
In-Reply-To: <200205060022.TAA03703@ccure.karaya.com>

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

On Sun, 05 May 2002 19:22:39 -0500
Jeff Dike <jdike@karaya.com> wrote:

> gang_hu@soul.com.cn said:
> > Ther problem in bread.
> 
> No, the problem is in not understanding UML.
> 
> UML's state is somewhat more complicated than the state of a native kernel.
> 
> You also need to recreate 
> 	the host processes
> 	the ptrace relationships between the tracing thread and the other 
> processes
> 	open file descriptors
> 	and maybe a few other things that aren't coming to mind
> 
> 				Jeff

Now , I found the Problem. Fix that have two way 
--1 after the register disk , We not close it.
--2 at prepare_request , We check the dev->count, it not open , must open it first.

The 1.diff is use the 1 way.
the 2.diff is use the 2 way.

Which is the best?
  
-- 
thanks with regards!
hugang.

***********************************
Beijing Soul Technology Co.,Ltd.
Tel:010-68425741/42/43/44
Fax:010-68425745
email:gang_hu@soul.com.cn
web:http://www.soul.com.cn
***********************************


[-- Attachment #2: 2.diff --]
[-- Type: text/plain, Size: 606 bytes --]

--- ubd.c~	Mon May  6 10:42:56 2002
+++ ubd.c.2	Mon May  6 10:46:06 2002
@@ -720,7 +720,22 @@
 		end_request(0);
 		return(1);
 	}
-
+	if(!dev->count) {
+		if (dev->file) {
+			if(ubd_open_dev(dev) < 0){
+				printk(KERN_ERR "unable to open %s for validation\n",
+				       dev->file);
+				return 1;
+			}
+		} else  return 1;
+		
+		/* have to recompute sizes since we opened it */
+		err = ubd_file_size(dev, &dev->size);
+		if(err) {
+			ubd_close(dev);
+			return 1;
+		}
+	}
         req->sector += ubd_part[minor].start_sect;
         block = req->sector;
         nsect = req->current_nr_sectors;

[-- Attachment #3: 1.diff --]
[-- Type: text/plain, Size: 1239 bytes --]

--- ubd.c~	Mon May  6 10:42:56 2002
+++ ubd.c	Mon May  6 10:49:11 2002
@@ -888,33 +888,26 @@
 	/* If it already has been opened we can check the partitions 
 	 * directly 
 	 */
-	if(dev->count){
-		part->start_sect = 0;
-		register_disk(&ubd_gendisk, MKDEV(MAJOR_NR, offset), pcount, 
-			      &ubd_blops, part->nr_sects);
-	} 
-	else if(dev->file){
-		if(ubd_open_dev(dev) < 0){
-			printk(KERN_ERR "unable to open %s for validation\n",
-			       dev->file);
-			return 1;
-		}
-
+	part->start_sect = 0;
+	if(!dev->count) {
+		if (dev->file) {
+			if(ubd_open_dev(dev) < 0){
+				printk(KERN_ERR "unable to open %s for validation\n",
+				       dev->file);
+				return 1;
+			}
+		} else  return 1;
+		
 		/* have to recompute sizes since we opened it */
 		err = ubd_file_size(dev, &dev->size);
 		if(err) {
 			ubd_close(dev);
 			return 1;
 		}
-		part->start_sect = 0;
 		part->nr_sects = dev->size / hardsect_sizes[offset];
-		register_disk(&ubd_gendisk, MKDEV(MAJOR_NR, offset), pcount, 
-			      &ubd_blops, part->nr_sects);
-
-		/* we are done so close it */
-		ubd_close(dev);
-	} 
-	else return(1);
+	}
+	register_disk(&ubd_gendisk, MKDEV(MAJOR_NR, offset), pcount, 
+		      &ubd_blops, part->nr_sects);
 	return(0);
 }
 

  reply	other threads:[~2002-05-06  3:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020505214819.19cb9a86.gang_hu@soul.com.cn>
2002-05-05 19:05 ` Pavel Machek
2002-05-06  0:22 ` Jeff Dike
2002-05-06  2:50   ` hugang [this message]
2002-05-06 15:18     ` Pavel Machek
2002-05-06 16:17       ` [PATH] Port software suspend " hugang
2002-05-06 19:05         ` Jeff Dike
2002-05-06 17:03       ` [PATH] Port software " Jeff Dike
2002-05-06  0:36 ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020506105025.217b96e6.gang_hu@soul.com.cn \
    --to=gang_hu@soul.com.cn \
    --cc=glonnon@ridgerun.com \
    --cc=jdike@karaya.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --cc=seasons@fornax.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®