Commit bac5bcac authored by Adam J. Richter's avatar Adam J. Richter Committed by Linus Torvalds

[PATCH] fix do_open() interaction with rd.c

	linux-2.5.28/drivers/block_dev.c has a new do_open that broke
initial ramdisk support, because it now requires devices that "manually"
set bdev->bd_openers to set bdev->bd_inode->i_size as well.  The
following single line patch, suggested by Russell King, fixes the
problem.

	There does not appear to be anyone acting as maintainer for
rd.c, so I posted to lkml yesterday to ask if anyone objected to my
submitting the patch to you, and I also emailed the message to Russell
King and Al Viro.  Nobody has complained.  I have been running the
patch for almost a day without problems.
parent 0cd3455f
...@@ -379,6 +379,7 @@ static int rd_open(struct inode * inode, struct file * filp) ...@@ -379,6 +379,7 @@ static int rd_open(struct inode * inode, struct file * filp)
rd_bdev[unit]->bd_openers++; rd_bdev[unit]->bd_openers++;
rd_bdev[unit]->bd_block_size = rd_blocksize; 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_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; rd_bdev[unit]->bd_queue = &blk_dev[MAJOR_NR].request_queue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment