On Thu, Mar 2, 2017 at 4:56 AM, Stefan Bader <stefan.ba...@canonical.com>
wrote:

> I created a modified patch and verified that
> - bcache base devices again are numbered 0,1,...
> - partioning a bcache device creates the expected bcacheXpY devices
> Will submit this change upstream (and for pre-stable zesty).
>
> ** Patch added: "0001-bcache-Fix-bcache-device-names.patch"
>    https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1667078/+attachment/4829714/+files/0001-bcache-Fix-bcache-
> device-names.patch
>
>
If possible, it would be good to avoid the div; that's why I had used a
shift.

In other drivers, they define a PART_BITS 4 or so
and use that to shift up or down to get index vs. minor.


> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1667078
>
> Title:
>   bcache device numbers increase by 16
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1667078/+subscriptions
>

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1667078

Title:
  bcache device numbers increase by 16

Status in linux package in Ubuntu:
  Confirmed

Bug description:
  On 4.10 kernel, when creating bcache devices, each device kname is now
  incremented by 16

  /dev/bcache0
  /dev/bcache16
  /dev/bcache32

  etc.

  This was to support partitioning of bcache devices[1], however, This
  also will limit the number of bcache devices and doesn't match how
  other block devices name themselves, md for example, you get md0p1,
  md1p1, md2p1 etc.

  Ideally we'd continue to see devices increment by 1, and ensure we
  allocate partition numbers as well.

  I think the patch[1] below is incomplete; I think we also want to
  shift the minor value by the number of partitions when we set the
  disk_name value.

  drivers/md/bcache/super.c:

     snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", minor);

  to

     snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", minor >>
  4);

  This should keep the devname index based, while creating the device node with
  the appropriate space for partitions, like this:

  $ ls -al /dev/bcache*
  brw-rw---- 1 root disk 251,  0 Feb 22 17:40 /dev/bcache0
  brw-rw---- 1 root disk 251,  1 Feb 22 17:40 /dev/bcache0p1
  brw-rw---- 1 root disk 251, 16 Feb 22 17:40 /dev/bcache1
  brw-rw---- 1 root disk 251, 17 Feb 22 17:40 /dev/bcache1p1

  
  1. https://www.spinics.net/lists/linux-bcache/msg04267.html

  ProblemType: Bug
  DistroRelease: Ubuntu 17.04
  Package: linux-image-4.10.0-8-generic 4.10.0-8.10
  ProcVersionSignature: User Name 4.10.0-8.10-generic 4.10.0-rc8
  Uname: Linux 4.10.0-8-generic x86_64
  AlsaDevices:
   total 0
   crw-rw---- 1 root audio 116,  1 Feb 22 17:36 seq
   crw-rw---- 1 root audio 116, 33 Feb 22 17:36 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
  ApportVersion: 2.20.4-0ubuntu2
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  Date: Wed Feb 22 17:41:18 2017
  Ec2AMI: ami-0000056c
  Ec2AMIManifest: FIXME
  Ec2AvailabilityZone: nova
  Ec2InstanceType: m1.small
  Ec2Kernel: unavailable
  Ec2Ramdisk: unavailable
  IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
  Lsusb: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  MachineType: OpenStack Foundation OpenStack Nova
  PciMultimedia:
   
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcFB:
   
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.10.0-8-generic 
root=UUID=15278dff-350d-42a1-8767-1424dfca7894 ro console=tty1 console=ttyS0
  RelatedPackageVersions:
   linux-restricted-modules-4.10.0-8-generic N/A
   linux-backports-modules-4.10.0-8-generic  N/A
   linux-firmware                            N/A
  RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
  SourcePackage: linux
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 04/01/2014
  dmi.bios.vendor: SeaBIOS
  dmi.bios.version: Ubuntu-1.8.2-1ubuntu1
  dmi.chassis.type: 1
  dmi.chassis.vendor: QEMU
  dmi.chassis.version: pc-i440fx-xenial
  dmi.modalias: 
dmi:bvnSeaBIOS:bvrUbuntu-1.8.2-1ubuntu1:bd04/01/2014:svnOpenStackFoundation:pnOpenStackNova:pvr13.1.2:cvnQEMU:ct1:cvrpc-i440fx-xenial:
  dmi.product.name: OpenStack Nova
  dmi.product.version: 13.1.2
  dmi.sys.vendor: OpenStack Foundation

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1667078/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to