EmbLogic's Blog

block driver crashes

#include
i

the driver crashes the moment it reaches add_disk…….following are the /var/log/messages…….rest works properly…..
hope if ani one helps.ya mi home directory has 0 bytes memory

Aug 5 10:03:45 zaffer kernel: [ 5936.683085]
Begin : start

Aug 5 10:03:45 zaffer kernel:
[ 5936.683087] HELLO KERNEL

Aug 5 10:03:45 zaffer kernel:[ 5936.683090] Registration Sucessful

Aug 5 10:03:45 zaffer kernel: [ 5936.683091]

Aug 5 10:03:45 zaffer kernel: [ 5936.683093] Major no is 252

Aug 5 10:03:45 zaffer kernel: [ 5936.683134] Memory allocation of block device sucessful

Aug 5 10:03:45 zaffer kernel: [ 5936.683135]

Aug 5 10:03:45 zaffer kernel: [ 5936.683136] after spin_lock

Aug 5 10:03:45 zaffer kernel: [ 5936.683137]

Aug 5 10:03:45 zaffer kernel: [ 5936.683145] alloc_disk sucessful

Aug 5 10:03:45 zaffer kernel: [ 5936.683146]

Aug 5 10:03:45 zaffer kernel: [ 5936.683161] sbullmajor

Aug 5 10:03:45 zaffer kernel: [ 5936.683162]

Aug 5 10:03:45 zaffer kernel: [ 5936.683163] sbullminor

Aug 5 10:03:45 zaffer kernel: [ 5936.683164]

Aug 5 10:03:45 zaffer kernel: [ 5936.683165] first_minor

Aug 5 10:03:45 zaffer kernel: [ 5936.683166]

Aug 5 10:03:45 zaffer kernel: [ 5936.683167] file_operations

Aug 5 10:03:45 zaffer kernel: [ 5936.683168]

Aug 5 10:03:45 zaffer kernel: [ 5936.683169] Queue

Aug 5 10:03:45 zaffer kernel: [ 5936.683169]

Aug 5 10:03:45 zaffer kernel: [ 5936.683170] private_data

Aug 5 10:03:45 zaffer kernel: [ 5936.683171]

Aug 5 10:03:45 zaffer kernel: [ 5936.683172] sbulla

Aug 5 10:03:45 zaffer kernel: [ 5936.683173]

Aug 5 10:03:45 zaffer kernel: [ 5936.683174] set_capacity

Aug 5 10:03:45 zaffer kernel: [ 5936.683175]

Aug 5 10:03:45 zaffer kernel: [ 5936.683176] ————[ cut here ]————
Aug 5 10:03:45 zaffer kernel: [ 5936.683183] WARNING: at block/genhd.c:527 add_disk+0x4d/0xef()

the message at block/genhd.c is as follows
void register_disk(struct gendisk *disk)
{

struct device *ddev = disk_to_dev(disk);

struct block_device *bdev;

struct disk_part_iter piter;

struct hd_struct *part;

int err;

ddev->parent = disk->driverfs_dev;

dev_set_name(ddev, disk->disk_name);

delay uevents, until we scanned partition table

dev_set_uevent_suppress(ddev, 1);

if (device_add(ddev))

return;

527 if (!sysfs_deprecated) {

err = sysfs_create_link(block_depr, &ddev->kobj,

kobject_name(&ddev->kobj));

if (err) {

device_del(ddev);

return;
}

}

}
nt main()
{
printf(“hello\n”);
return 0;
/*
Aug 5 10:03:45 zaffer kernel:
[ 5936.683085] Begin : start

Aug 5 10:03:45 zaffer kernel:
[ 5936.683087] HELLO KERNEL

Aug 5 10:03:45 zaffer kernel:
[ 5936.683090] Registration Sucessful

Aug 5 10:03:45 zaffer kernel:
[ 5936.683091]
Aug 5 10:03:45 zaffer kernel:
[ 5936.683093] Major no is 252

Aug 5 10:03:45 zaffer kernel: [ 5936.683134] Memory allocation of block device sucessful

Aug 5 10:03:45 zaffer kernel: [ 5936.683135]

Aug 5 10:03:45 zaffer kernel: [ 5936.683136] after spin_lock

Aug 5 10:03:45 zaffer kernel: [ 5936.683137]

Aug 5 10:03:45 zaffer kernel: [ 5936.683145] alloc_disk sucessful

Aug 5 10:03:45 zaffer kernel: [ 5936.683146]

Aug 5 10:03:45 zaffer kernel: [ 5936.683161] sbullmajor

Aug 5 10:03:45 zaffer kernel: [ 5936.683162]

Aug 5 10:03:45 zaffer kernel: [ 5936.683163] sbullminor

Aug 5 10:03:45 zaffer kernel: [ 5936.683164]

Aug 5 10:03:45 zaffer kernel: [ 5936.683165] first_minor

Aug 5 10:03:45 zaffer kernel: [ 5936.683166]

Aug 5 10:03:45 zaffer kernel: [ 5936.683167] file_operations

Aug 5 10:03:45 zaffer kernel: [ 5936.683168]

Aug 5 10:03:45 zaffer kernel: [ 5936.683169] Queue

Aug 5 10:03:45 zaffer kernel: [ 5936.683169]

Aug 5 10:03:45 zaffer kernel: [ 5936.683170] private_data

Aug 5 10:03:45 zaffer kernel: [ 5936.683171]

Aug 5 10:03:45 zaffer kernel: [ 5936.683172] sbulla

Aug 5 10:03:45 zaffer kernel: [ 5936.683173]

Aug 5 10:03:45 zaffer kernel: [ 5936.683174] set_capacity

Aug 5 10:03:45 zaffer kernel: [ 5936.683175]

Aug 5 10:03:45 zaffer kernel: [ 5936.683176] ————[ cut here ]————
Aug 5 10:03:45 zaffer kernel: [ 5936.683183] WARNING: at block/genhd.c:527 add_disk+0x4d/0xef()

the message at block/genhd.c is as follows
void register_disk(struct gendisk *disk)
{

struct device *ddev = disk_to_dev(disk);

struct block_device *bdev;

struct disk_part_iter piter;

struct hd_struct *part;

int err;

ddev->parent = disk->driverfs_dev;

dev_set_name(ddev, disk->disk_name);

delay uevents, until we scanned partition table

dev_set_uevent_suppress(ddev, 1);

if (device_add(ddev))

return;

527 if (!sysfs_deprecated) {

err = sysfs_create_link(block_depr, &ddev->kobj,

kobject_name(&ddev->kobj));

if (err) {

device_del(ddev);

return;
}

}

}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>