public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Patch?: initial ramdisks did not work in 2.5.28-29
@ 2002-07-28 23:42 Adam J. Richter
  2002-07-28 23:51 ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Adam J. Richter @ 2002-07-28 23:42 UTC (permalink / raw)
  To: andrea, linux-kernel

	Initial ramdisks do not work in linux-2.5.2{8,9}, because
fs/block_dev.c in these kernels has a new version of bd_open()
that does not set bdev->bd_inode->i_size when bdev->bd_openers is
non-zero.

	I would appreciate information on whether this change in
bd_open's behavior is intended.  If it is, then the following
patch makes updates the ramdisk driver to work again.

	Also, I would appreciate knowing if anyone is acting as
maintainer for drivers/block/rd.c, or if I should just send
patches for rd.c directly to Linus if nobody complains on
the linux-kernel mailing list.  I have some other minor patches for rd.c
to reduce its use of minor device numbers, and a patch that someone
whose name I don't remember posted long ago for dropping pages that
contiain all zeroes.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

--- linux-2.5.29/drivers/block/rd.c	2002-07-26 19:58:39.000000000 -0700
+++ linux/drivers/block/rd.c	2002-07-28 16:28:03.000000000 -0700
@@ -379,6 +404,7 @@
 		rd_bdev[unit]->bd_openers++;
 		rd_bdev[unit]->bd_block_size = rd_blocksize;
 		rd_bdev[unit]->bd_inode->i_mapping->a_ops = &ramdisk_aops;
+		rd_bdev[unit]->bd_inode->i_size = rd_kbsize[unit] << 10;
 		rd_bdev[unit]->bd_queue = &blk_dev[MAJOR_NR].request_queue;
 	}
 

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

* Re: Patch?: initial ramdisks did not work in 2.5.28-29
  2002-07-28 23:42 Patch?: initial ramdisks did not work in 2.5.28-29 Adam J. Richter
@ 2002-07-28 23:51 ` Russell King
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King @ 2002-07-28 23:51 UTC (permalink / raw)
  To: Adam J. Richter; +Cc: andrea, linux-kernel

On Sun, Jul 28, 2002 at 04:42:20PM -0700, Adam J. Richter wrote:
> 	Initial ramdisks do not work in linux-2.5.2{8,9}, because

Correct.

> 	Also, I would appreciate knowing if anyone is acting as
> maintainer for drivers/block/rd.c, or if I should just send
> patches for rd.c directly to Linus if nobody complains on
> the linux-kernel mailing list.

Al has been working on the problem.  To permanently fix it so it doesn't
break each time a change to do_open() happens.  Yes, this ramdisk driver
is that brittle.

> +		rd_bdev[unit]->bd_inode->i_size = rd_kbsize[unit] << 10;

My temporary hack around the problem was to use rd_length[unit] since
that's already in bytes.  But anything that adds code here just makes
the driver slightly more brittle.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


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

* Re: Patch?: initial ramdisks did not work in 2.5.28-29
@ 2002-07-29  0:17 Adam J. Richter
  0 siblings, 0 replies; 3+ messages in thread
From: Adam J. Richter @ 2002-07-29  0:17 UTC (permalink / raw)
  To: rmk, viro; +Cc: andrea, linux-kernel

On Mon, 29 Jul 2002 00:51:56 +0100, Russell King wrote:
>On Sun, Jul 28, 2002 at 04:42:20PM -0700, Adam J. Richter wrote:
>> 	Initial ramdisks do not work in linux-2.5.2{8,9}, because

>Correct.
[...]
>Al has been working on the problem.  To permanently fix it so it doesn't
>break each time a change to do_open() happens.
[...]
>My temporary hack around the problem was to use rd_length[unit] since
>that's already in bytes.
[...]

	Thanks for the quick response.  Your solution is simpler.

	Although some bigger change may be in the works, would anyone
object to my submitting the following patch (your version of the fix)
to Linus in the meantime?  I am cc'ing this message to Al Viro.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

--- linux-2.5.29/drivers/block/rd.c	2002-07-26 19:58:39.000000000 -0700
+++ linux/drivers/block/rd.c	2002-07-28 16:59:05.000000000 -0700
@@ -379,6 +404,7 @@
 		rd_bdev[unit]->bd_openers++;
 		rd_bdev[unit]->bd_block_size = rd_blocksize;
 		rd_bdev[unit]->bd_inode->i_mapping->a_ops = &ramdisk_aops;
+		rd_bdev[unit]->bd_inode->i_size = rd_length[unit];
 		rd_bdev[unit]->bd_queue = &blk_dev[MAJOR_NR].request_queue;
 	}
 

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

end of thread, other threads:[~2002-07-29  0:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-28 23:42 Patch?: initial ramdisks did not work in 2.5.28-29 Adam J. Richter
2002-07-28 23:51 ` Russell King
  -- strict thread matches above, loose matches on Subject: below --
2002-07-29  0:17 Adam J. Richter

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