Re: [PATCH] fix for initrd breakage in 2.5.13+

James Bottomley (James.Bottomley@SteelEye.com)
Wed, 15 May 2002 15:35:28 -0400


This is a multipart MIME message.

--==_Exmh_19067810270
Content-Type: text/plain; charset=us-ascii

rmk@arm.linux.org.uk said:
> --- drivers/block/rd.c Fri May 3 03:26:05 2002 +++ /tmp/rd.c Mon May
> 6 03:00:00 2002 @@ -376,6 +376,7 @@
> rd_bdev[unit] = bdget(kdev_t_to_nr(inode->i_rdev));
> rd_bdev[unit]->bd_openers++;
> rd_bdev[unit]->bd_inode->i_mapping->a_ops = &ramdisk_aops;
> + rd_bdev[unit]->bd_block_size = rd_blocksize;
> }
> return 0;

Ah Thanks!. Yes, that's the bit I was looking for. It also explains why
bd_openers was already incremented.

I think you still need to set the block queue hardsect size correctly as well,
so the final fix for the initrd problems should be the attached (which works
for me).

James

--==_Exmh_19067810270
Content-Type: text/plain ; name="tmp.diff"; charset=us-ascii
Content-Description: tmp.diff
Content-Disposition: attachment; filename="tmp.diff"

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.513 -> 1.514
# drivers/block/rd.c 1.35 -> 1.36
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/05/15 jejb@mulgrave.(none) 1.514
# rd.c blocksize fix
# --------------------------------------------
#
diff -Nru a/drivers/block/rd.c b/drivers/block/rd.c
--- a/drivers/block/rd.c Wed May 15 15:21:55 2002
+++ b/drivers/block/rd.c Wed May 15 15:21:55 2002
@@ -376,6 +376,7 @@
rd_bdev[unit] = bdget(kdev_t_to_nr(inode->i_rdev));
rd_bdev[unit]->bd_openers++;
rd_bdev[unit]->bd_inode->i_mapping->a_ops = &ramdisk_aops;
+ rd_bdev[unit]->bd_block_size = rd_blocksize;
}

return 0;
@@ -424,6 +425,7 @@
}

blk_queue_make_request(BLK_DEFAULT_QUEUE(MAJOR_NR), &rd_make_request);
+ blk_queue_hardsect_size(BLK_DEFAULT_QUEUE(MAJOR_NR), rd_blocksize);

for (i = 0; i < NUM_RAMDISKS; i++) {
/* rd_size is given in kB */

--==_Exmh_19067810270--

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