lkml.org 
[lkml]   [2003]   [Feb]   [20]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateThu, 20 Feb 2003 11:08:51 +0300
FromOleg Drokin <>
SubjectRe: uml-patch-2.5.62-1
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/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.362 / U:0.010 seconds]
©2003-2008 Jasper Spaans