Re: [PATCH 4/4] virtio_blk: use disk_name_format() to support mass of disks naming

6 messages, 4 authors, 2012-04-12 · open the first message on its own page

Re: [PATCH 4/4] virtio_blk: use disk_name_format() to support mass of disks naming

From: Tejun Heo <tj@kernel.org>
Date: 2012-03-30 15:26:21

On Fri, Mar 30, 2012 at 05:53:52PM +0800, Ren Mingxin wrote:
 The current virtblk's naming algorithm only supports 263  disks.
If there are mass of virtblks(exceeding 263), there will be disks
with the same name.

By renaming "sd_format_disk_name()" to "disk_name_format()"
and moving it into block core, virtio_blk can use this function to
support mass of disks.

Signed-off-by: Ren Mingxin <redacted>
I guess it's already way too late but why couldn't they have been
named vdD-P where both D and P are integers denoting disk number and
partition number?  [sh]dX's were created when there weren't supposed
to be too many disks, so we had to come up with the horrible alphabet
based numbering scheme but vd is new enough.  I mean, naming is one
thing but who wants to figure out which sequence is or guess what
comes next vdzz9?  :(

If we're gonna move it to block layer, let's add big blinking red
comment saying "don't ever use it for any new driver".

Thanks.

-- 
tejun

Re: [PATCH 4/4] virtio_blk: use disk_name_format() to support mass of disks naming

From: Tejun Heo <tj@kernel.org>
Date: 2012-03-30 15:28:18

On Fri, Mar 30, 2012 at 08:26:06AM -0700, Tejun Heo wrote:
On Fri, Mar 30, 2012 at 05:53:52PM +0800, Ren Mingxin wrote:
quoted
 The current virtblk's naming algorithm only supports 263  disks.
If there are mass of virtblks(exceeding 263), there will be disks
with the same name.

By renaming "sd_format_disk_name()" to "disk_name_format()"
and moving it into block core, virtio_blk can use this function to
support mass of disks.

Signed-off-by: Ren Mingxin <redacted>
I guess it's already way too late but why couldn't they have been
named vdD-P where both D and P are integers denoting disk number and
partition number?  [sh]dX's were created when there weren't supposed
to be too many disks, so we had to come up with the horrible alphabet
based numbering scheme but vd is new enough.  I mean, naming is one
thing but who wants to figure out which sequence is or guess what
comes next vdzz9?  :(

If we're gonna move it to block layer, let's add big blinking red
comment saying "don't ever use it for any new driver".
And also let's make that clear in the function name - say,
format_legacy_disk_name() or something.

Thanks.

-- 
tejun

Re: [PATCH 4/4] virtio_blk: use disk_name_format() to support mass of disks naming

From: Tejun Heo <tj@kernel.org>
Date: 2012-03-30 15:38:28

On Fri, Mar 30, 2012 at 08:26:06AM -0700, Tejun Heo wrote:
On Fri, Mar 30, 2012 at 05:53:52PM +0800, Ren Mingxin wrote:
quoted
 The current virtblk's naming algorithm only supports 263  disks.
If there are mass of virtblks(exceeding 263), there will be disks
with the same name.

By renaming "sd_format_disk_name()" to "disk_name_format()"
and moving it into block core, virtio_blk can use this function to
support mass of disks.

Signed-off-by: Ren Mingxin <redacted>
I guess it's already way too late but why couldn't they have been
named vdD-P where both D and P are integers denoting disk number and
So, if a device name ends in digit the partition code adds delimiter
'p' automatically and this is already in use by md.  So, partitioned
md devices are named mdDpP where D and P are base 10 number indicating
the sequence like md12p4.  So, let's please add comment that new
drivers should name their devices PREFIX%d where the sequence number
can be allocated by ida.

Thanks.

-- 
tejun

Re: [PATCH 4/4] virtio_blk: use disk_name_format() to support mass of disks naming

From: Ren Mingxin <hidden>
Date: 2012-04-02 01:19:05

 On 03/30/2012 11:28 PM, Tejun Heo wrote:
On Fri, Mar 30, 2012 at 08:26:06AM -0700, Tejun Heo wrote:
quoted
On Fri, Mar 30, 2012 at 05:53:52PM +0800, Ren Mingxin wrote:
quoted
  The current virtblk's naming algorithm only supports 263  disks.
If there are mass of virtblks(exceeding 263), there will be disks
with the same name.

By renaming "sd_format_disk_name()" to "disk_name_format()"
and moving it into block core, virtio_blk can use this function to
support mass of disks.

Signed-off-by: Ren Mingxin<redacted>
I guess it's already way too late but why couldn't they have been
named vdD-P where both D and P are integers denoting disk number and
partition number?  [sh]dX's were created when there weren't supposed
to be too many disks, so we had to come up with the horrible alphabet
based numbering scheme but vd is new enough.  I mean, naming is one
thing but who wants to figure out which sequence is or guess what
comes next vdzz9?  :(

If we're gonna move it to block layer, let's add big blinking red
comment saying "don't ever use it for any new driver".
And also let's make that clear in the function name - say,
format_legacy_disk_name() or something.
So, to legacy disks [sh]d, we'd name them as [sh]d[a-z]{1,}. To new devices
like vd, we'd name them as vd<index>(vd<index>p<partno> as partitions)?
And how about the rssd in the patch 3 then?

Besides, does anybody have comments?
Looking forward to your replies ;-)

-- 
Thanks,
Ren

Re: [PATCH 4/4] virtio_blk: use disk_name_format() to support mass of disks naming

From: Michael S. Tsirkin <mst@redhat.com>
Date: 2012-04-02 07:15:31

On Fri, Mar 30, 2012 at 08:26:06AM -0700, Tejun Heo wrote:
On Fri, Mar 30, 2012 at 05:53:52PM +0800, Ren Mingxin wrote:
quoted
 The current virtblk's naming algorithm only supports 263  disks.
If there are mass of virtblks(exceeding 263), there will be disks
with the same name.

By renaming "sd_format_disk_name()" to "disk_name_format()"
and moving it into block core, virtio_blk can use this function to
support mass of disks.

Signed-off-by: Ren Mingxin <redacted>
I guess it's already way too late but why couldn't they have been
named vdD-P where both D and P are integers denoting disk number and
partition number?
Yes they could and yes it's way too late to change device
names for virtio - if we did this will break countless setups.
 [sh]dX's were created when there weren't supposed
to be too many disks, so we had to come up with the horrible alphabet
based numbering scheme but vd is new enough.  I mean, naming is one
thing but who wants to figure out which sequence is or guess what
comes next vdzz9?  :(

If we're gonna move it to block layer, let's add big blinking red
comment saying "don't ever use it for any new driver".

Thanks.
Right. virtio would have to use the legacy one though.
-- 
tejun

Re: [PATCH 4/4] virtio_blk: use disk_name_format() to support mass of disks naming

From: Jeff Garzik <hidden>
Date: 2012-04-12 20:18:04

On 03/30/2012 11:26 AM, Tejun Heo wrote:
If we're gonna move it to block layer, let's add big blinking red
comment saying "don't ever use it for any new driver".
Big ACK to that...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help