Skip to contentSkip to conversation

block/ub.c: Increase number of partitions for usb storage

PATCH Pete Zaitcev 3 participants 3 messages May 3, 2006 – May 11, 2006 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Hans A Eide

I do backups to external USB storage and hit the 8 partitions limit of ub.c
This could also be a problem for others (HFS+ formatted iPods?)

It was a bad mistake in retrospect. I limited ub to 8 partitions because I wanted to fit 26 devices into 8 bits of minor.

Quoted 1 line

Any reason for not increasing the partitions limit to 16?

Doing so would not be compatible for systems which do not run udevd. Linus forbade such changes, and I agree. So, if we strongly needed ub to go beyond 1+7 partitions, we would need some kind of a remapping scheme. I have to discuss this with Greg or Harald. Making dis- contiguous nodes is easy with mknod, but I do not know if udev supports it.

Review line 116

Quoted 7 lines

+++ drivers/block/ub.c 2006-04-30 13:37:34.000000000 +0200

(quoted diff) +1 -1
@@ -113,7 +113,7 @@
 /*
   */
-#define UB_PARTS_PER_LUN      8
+#define UB_PARTS_PER_LUN      16
 #define UB_MAX_CDB_SIZE      16                /* Corresponds to Bulk */

Your mailer corrupted your patch. The attached ought to work better, but it's a subject to aforementioned compatibility problems.

-- Pete

drivers/block/ub.c +1 -1
@@ -113,7 +109,7 @@
 /*
  */
 
-#define UB_PARTS_PER_LUN      8
+#define UB_PARTS_PER_LUN     16
 
 #define UB_MAX_CDB_SIZE      16		/* Corresponds to Bulk */
 
Documentation/devices.txt +4 -4
diff -urp -X dontdiff linux-2.6.17-rc2/Documentation/devices.txt linux-2.6.17-rc2-lem/Documentation/devices.txt
@@ -2557,10 +2557,10 @@ Your cooperation is appreciated.
 		 66 = /dev/usb/cpad0	Synaptics cPad (mouse/LCD)
 
 180 block	USB block devices
-		0 = /dev/uba		First USB block device
-		8 = /dev/ubb		Second USB block device
-		16 = /dev/ubc		Thrid USB block device
-		...
+		  0 = /dev/uba		First USB block device
+		 16 = /dev/ubb		Second USB block device
+		 32 = /dev/ubc		Third USB block device
+		    ...
 
 181 char	Conrad Electronic parallel port radio clocks
 		  0 = /dev/pcfclock0	First Conrad radio clock
#2 lore raw
Quoted 9 lines · Pete Zaitcev
Quoted 3 lines · Hans A Eide

I do backups to external USB storage and hit the 8 partitions limit of ub.c
This could also be a problem for others (HFS+ formatted iPods?)

It was a bad mistake in retrospect. I limited ub to 8 partitions because I wanted to fit 26 devices into 8 bits of minor.

Quoted 8 lines
Quoted 1 line

Any reason for not increasing the partitions limit to 16?

Doing so would not be compatible for systems which do not run udevd. Linus forbade such changes, and I agree. So, if we strongly needed ub to go beyond 1+7 partitions, we would need some kind of a remapping scheme. I have to discuss this with Greg or Harald. Making dis- contiguous nodes is easy with mknod, but I do not know if udev supports it.

udev can handle it just fine, as it just looks at the sysfs "dev" file to get the major:minor numbers. It knows nothing about "ranges" :)

thanks,

greg k-h

#3 lore raw
Quoted 19 lines · Greg KH
Quoted 9 lines · Pete Zaitcev
Quoted 3 lines · Hans A Eide

I do backups to external USB storage and hit the 8 partitions limit of ub.c
This could also be a problem for others (HFS+ formatted iPods?)

It was a bad mistake in retrospect. I limited ub to 8 partitions because I wanted to fit 26 devices into 8 bits of minor.

Quoted 8 lines
Quoted 1 line

Any reason for not increasing the partitions limit to 16?

Doing so would not be compatible for systems which do not run udevd. Linus forbade such changes, and I agree. So, if we strongly needed ub to go beyond 1+7 partitions, we would need some kind of a remapping scheme. I have to discuss this with Greg or Harald. Making dis- contiguous nodes is easy with mknod, but I do not know if udev supports it.

Quoted 2 lines

udev can handle it just fine, as it just looks at the sysfs "dev" file to get the major:minor numbers. It knows nothing about "ranges" :)

I can confirm this in practice. Good magic :-)

Hans

--
+ +
Hans A Eide, PhD. Senior Analyst, USIT
[email protected] University of Oslo, Norway
+ +