Having problems after the add_disk() call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am writing a block virtual driver on the lines of Linux Device Drivers book 3rd Edition.which is the sbull one. What I have done in my code is my open function call implementation has just a printk statement. I have done the initializiation of the request queue as well by calling blk_init_queue() function. At the end I have added add_disk() in the init function. However I get the following error :-

Buffer I/O on logical block 0 . Unable to read the partition table etc. However if I comment the add_disk it doesn’t throw me an error. According to the book, I understand that the disk is live , which means even before add_disk() function returns , the kernel tries to read the partition table and also there could be requests taking place.

So how can I get rid of this problem. I create a mknod by hand from the command-line  mknod –m 666 /dev/<name> b <major> <minor>.

The major number I get from register_blkdev and the minor no. I give from the first_minor which is in struct gendisk , which I have set it to 0.

I test this using dd if=/dev/<name> of=/dev/null bs=512 count=1. It gives me the same error.

Can you please help me out. It’s urgent.

 


http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@xxxxxxxxx and delete this mail.
_____________________________________________________________________

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux