Re: uml-patch-2.5.62-1

From: Oleg Drokin (green@namesys.com)
Date: Thu Feb 20 2003 - 03:08:51 EST


Hello!

On Wed, Feb 19, 2003 at 03:08:08PM -0500, Jeff Dike wrote:

> ubd driver cleanups and fixes

Ah, great. Except it introduced new breakage.
That hunk below from your diff adds add_disk() call.
Notice how a bit down we have another call to add_disk(),
that is not removed. So we end up woth two add_disk() calls.
Of course sysfs gets upset immediately (probably not only it).

diff -Naur a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
--- a/arch/um/drivers/ubd_kern.c Wed Feb 19 11:24:39 2003
+++ b/arch/um/drivers/ubd_kern.c Wed Feb 19 11:29:49 2003
@@ -499,17 +516,22 @@
        disk->major = major;
        disk->first_minor = minor;
        disk->fops = &ubd_blops;
+ disk->private_data = dev;
+ disk->queue = &ubd_queue;
        set_capacity(disk, size / 512);
- /* needs to be ubd -> /dev/ubd/discX/disc */
- sprintf(disk->disk_name, "ubd");
+ sprintf(disk->disk_name, name);
        *disk_out = disk;
+ add_disk(disk);

- /* /dev/ubd/N style names */
- sprintf(devfs_name, "%d", unit);
- *handle_out = devfs_register(dir_handle, devfs_name,
- DEVFS_FL_REMOVABLE, major, minor,
- S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |
- S_IWGRP, &ubd_blops, NULL);
+ if(handle_out != NULL){
+ /* /dev/ubd/N style names */
+ sprintf(devfs_name, "%d", unit);
+ *handle_out = devfs_register(dir_handle, devfs_name,
+ DEVFS_FL_DEFAULT, major, minor,
+ S_IFBLK | S_IRUSR | S_IWUSR |
+ S_IRGRP | S_IWGRP, &ubd_blops,
+ NULL);
+ }
        disk->private_data = &ubd_dev[unit];
        disk->queue = &ubd_queue;
        add_disk(disk);

Bye,
    Oleg
-
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/



This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:28 EST