lkml.org 
[lkml]   [2000]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [rfc][patchlet] initrd fix 2.3.39

Hello Mike,

your patch fixes the main problem, the Oops message. Thanks, that leads me
some steps further.

But some problems still persist and I will give them a try tomorrow :
- if you try to copy /dev/initrd to some other file,
there is the message "No such device", but if you're doing a mknod
c,1,250 then the special node already exists.
- if you try to make a filesystem on a ramdisk
(i.e. dd if=/dev/zero of=/dev/ram1 bs=1024k count=8; mke2fs /dev/ram1)
then everything works fine up to the moment when you want to mount
that ramdisk. It either gives "you must specify the filesystem type"
without option "-t ext2" or "wrong fs type, ...." with it.
The length of the ramdisk is exactly 8MB. (wc -l)
I will track down this point tomorrow a bit further, comparing
ramdisk-e2fs with file-e2fs of the same size.

Do you have any explanation for that behaviour ?
Shall I make some more tests ?

Mit freundlichen Grüßen / kind regards

Frank


Frank Bernard Informationstechnik GmbH
vanity +49 700 FIREWALL (0700 FIREWALL) phone : +49 69 477169
Dipl.-Inform. Frank Bernard fax : +49 69 47885616
Wehrheimerstr. 9 email : fb@fbit.de
60389 Frankfurt www : http://www.fbit.de
Germany http://www.linuxwall.de

On Sun, 16 Jan 2000, Mike Galbraith wrote:

> Hi,
>
> This patchlet allows me to load a gzipped initrd using loadlin.
> Does it look reasonable, or does blkdev_open() need to die?
>
> -Mike
>
> --- linux-2.3.39/drivers/block/rd.c.org Fri Jan 14 05:47:55 2000
> +++ linux-2.3.39/drivers/block/rd.c Sun Jan 16 12:10:23 2000
> @@ -336,31 +336,19 @@
> return 0;
> }
>
> -
> static struct file_operations initrd_fops = {
> - NULL, /* lseek */
> - initrd_read, /* read */
> - NULL, /* write */
> - NULL, /* readdir */
> - NULL, /* poll */
> - NULL, /* ioctl */
> - NULL, /* mmap */
> - NULL, /* open */
> - NULL, /* flush */
> - initrd_release, /* release */
> - NULL /* fsync */
> + release: initrd_release,
> + read: initrd_read,
> };
>
> #endif
>
> -
> static int rd_open(struct inode * inode, struct file * filp)
> {
> #ifdef CONFIG_BLK_DEV_INITRD
> if (DEVICE_NR(inode->i_rdev) == INITRD_MINOR) {
> if (!initrd_start) return -ENODEV;
> initrd_users++;
> - filp->f_op = &initrd_fops;
> return 0;
> }
> #endif
> @@ -560,6 +548,7 @@
> struct inode inode, out_inode;
> struct file infile, outfile;
> struct dentry in_dentry, out_dentry;
> + struct block_device *idev, *odev;
> mm_segment_t fs;
> kdev_t ram_device;
> int nblocks, i;
> @@ -568,24 +557,34 @@
> unsigned short devblocks = 0;
> char rotator[4] = { '|' , '/' , '-' , '\\' };
>
> + if ((idev = bdget(device)) == NULL)
> + return;
> +
> ram_device = MKDEV(MAJOR_NR, unit);
>
> + if ((odev = bdget(ram_device)) == NULL)
> + return;
> +
> memset(&infile, 0, sizeof(infile));
> memset(&inode, 0, sizeof(inode));
> memset(&in_dentry, 0, sizeof(in_dentry));
> + inode.i_bdev = idev;
> inode.i_rdev = device;
> init_waitqueue_head(&inode.i_wait);
> infile.f_mode = 1; /* read only */
> infile.f_dentry = &in_dentry;
> + infile.f_op = &initrd_fops;
> in_dentry.d_inode = &inode;
>
> memset(&outfile, 0, sizeof(outfile));
> memset(&out_inode, 0, sizeof(out_inode));
> memset(&out_dentry, 0, sizeof(out_dentry));
> + out_inode.i_bdev = odev;
> out_inode.i_rdev = ram_device;
> init_waitqueue_head(&out_inode.i_wait);
> outfile.f_mode = 3; /* read/write */
> outfile.f_dentry = &out_dentry;
> + outfile.f_op = &def_blk_fops;
> out_dentry.d_inode = &out_inode;
>
> if (blkdev_open(&inode, &infile) != 0) return;
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.700 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site