Re: Change in register_blkdev() behavior

2018-02-01 Thread Logan Gunthorpe
On 01/02/18 07:17 PM, Srivatsa S. Bhat wrote: > Thank you for confirming! I'll send a patch to fix that (and the analogous > case for CHRDEV_MAJOR_DYN_EXT_END). Great! Thanks! >>> >>> for (cd = chrdevs[major_to_index(i)]; cd; cd = cd->next) >>> if

Re: Change in register_blkdev() behavior

2018-02-01 Thread Logan Gunthorpe
On 01/02/18 07:17 PM, Srivatsa S. Bhat wrote: > Thank you for confirming! I'll send a patch to fix that (and the analogous > case for CHRDEV_MAJOR_DYN_EXT_END). Great! Thanks! >>> >>> for (cd = chrdevs[major_to_index(i)]; cd; cd = cd->next) >>> if

Re: Change in register_blkdev() behavior

2018-02-01 Thread Srivatsa S. Bhat
On 2/1/18 5:10 PM, Logan Gunthorpe wrote: > > > On 01/02/18 05:23 PM, Srivatsa S. Bhat wrote: >> static int find_dynamic_major(void) >> { >> int i; >> struct char_device_struct *cd; >> >> for (i = ARRAY_SIZE(chrdevs)-1; i > CHRDEV_MAJOR_DYN_END; i--) { >>   

Re: Change in register_blkdev() behavior

2018-02-01 Thread Srivatsa S. Bhat
On 2/1/18 5:10 PM, Logan Gunthorpe wrote: > > > On 01/02/18 05:23 PM, Srivatsa S. Bhat wrote: >> static int find_dynamic_major(void) >> { >> int i; >> struct char_device_struct *cd; >> >> for (i = ARRAY_SIZE(chrdevs)-1; i > CHRDEV_MAJOR_DYN_END; i--) { >>   

Re: Change in register_blkdev() behavior

2018-02-01 Thread Logan Gunthorpe
On 01/02/18 05:23 PM, Srivatsa S. Bhat wrote: static int find_dynamic_major(void) { int i; struct char_device_struct *cd; for (i = ARRAY_SIZE(chrdevs)-1; i > CHRDEV_MAJOR_DYN_END; i--) { As far as I can see, _DYN_END is

Re: Change in register_blkdev() behavior

2018-02-01 Thread Logan Gunthorpe
On 01/02/18 05:23 PM, Srivatsa S. Bhat wrote: static int find_dynamic_major(void) { int i; struct char_device_struct *cd; for (i = ARRAY_SIZE(chrdevs)-1; i > CHRDEV_MAJOR_DYN_END; i--) { As far as I can see, _DYN_END is

Re: Change in register_blkdev() behavior

2018-02-01 Thread Srivatsa S. Bhat
On 1/31/18 6:24 AM, Greg KH wrote: > On Tue, Jan 30, 2018 at 04:56:32PM -0800, Srivatsa S. Bhat wrote: >> >> Hi, >> >> Before commit 133d55cdb2f "block: order /proc/devices by major number", >> if register_blkdev() was called with major = [1..UINT_MAX], it used to >> succeed (provided the

Re: Change in register_blkdev() behavior

2018-02-01 Thread Srivatsa S. Bhat
On 1/31/18 6:24 AM, Greg KH wrote: > On Tue, Jan 30, 2018 at 04:56:32PM -0800, Srivatsa S. Bhat wrote: >> >> Hi, >> >> Before commit 133d55cdb2f "block: order /proc/devices by major number", >> if register_blkdev() was called with major = [1..UINT_MAX], it used to >> succeed (provided the

Re: Change in register_blkdev() behavior

2018-02-01 Thread Srivatsa S. Bhat
Hi Logan, On 1/30/18 5:26 PM, Logan Gunthorpe wrote: > > > On 30/01/18 05:56 PM, Srivatsa S. Bhat wrote: >> If the restriction on the major number was intentional, perhaps we >> should get the LTP testcase modified for kernel versions >= 4.14. >> Otherwise, we should fix register_blkdev to

Re: Change in register_blkdev() behavior

2018-02-01 Thread Srivatsa S. Bhat
Hi Logan, On 1/30/18 5:26 PM, Logan Gunthorpe wrote: > > > On 30/01/18 05:56 PM, Srivatsa S. Bhat wrote: >> If the restriction on the major number was intentional, perhaps we >> should get the LTP testcase modified for kernel versions >= 4.14. >> Otherwise, we should fix register_blkdev to

Re: Change in register_blkdev() behavior

2018-01-31 Thread Greg KH
On Tue, Jan 30, 2018 at 04:56:32PM -0800, Srivatsa S. Bhat wrote: > > Hi, > > Before commit 133d55cdb2f "block: order /proc/devices by major number", > if register_blkdev() was called with major = [1..UINT_MAX], it used to > succeed (provided the requested major number was actually free). How

Re: Change in register_blkdev() behavior

2018-01-31 Thread Greg KH
On Tue, Jan 30, 2018 at 04:56:32PM -0800, Srivatsa S. Bhat wrote: > > Hi, > > Before commit 133d55cdb2f "block: order /proc/devices by major number", > if register_blkdev() was called with major = [1..UINT_MAX], it used to > succeed (provided the requested major number was actually free). How

Re: Change in register_blkdev() behavior

2018-01-30 Thread Logan Gunthorpe
On 30/01/18 05:56 PM, Srivatsa S. Bhat wrote: If the restriction on the major number was intentional, perhaps we should get the LTP testcase modified for kernel versions >= 4.14. Otherwise, we should fix register_blkdev to preserve the old behavior. (I guess the same thing applies to commit

Re: Change in register_blkdev() behavior

2018-01-30 Thread Logan Gunthorpe
On 30/01/18 05:56 PM, Srivatsa S. Bhat wrote: If the restriction on the major number was intentional, perhaps we should get the LTP testcase modified for kernel versions >= 4.14. Otherwise, we should fix register_blkdev to preserve the old behavior. (I guess the same thing applies to commit