Re: [PATCHv3] Update scsi host to use ida for host number

2015-09-03 Thread Lee Duncan
On 09/01/2015 11:48 PM, Christoph Hellwig wrote: > On Tue, Sep 01, 2015 at 05:03:28PM -0700, Lee Duncan wrote: >> +static int host_get_index(int *index) >> +{ >> +int error = -ENOMEM; >> + >> +do { >> +if (!ida_pre_get(&host_index_ida, GFP_KERNEL)) >> +break;

Re: [PATCHv3] Update scsi host to use ida for host number

2015-09-01 Thread Christoph Hellwig
On Tue, Sep 01, 2015 at 05:03:28PM -0700, Lee Duncan wrote: > +static int host_get_index(int *index) > +{ > + int error = -ENOMEM; > + > + do { > + if (!ida_pre_get(&host_index_ida, GFP_KERNEL)) > + break; > + spin_lock(&host_index_lock); > +

[PATCHv3] Update scsi host to use ida for host number

2015-09-01 Thread Lee Duncan
Each Scsi_host instance gets a host number starting at 0, but this is implemented with an atomic integer, and rollover doesn't seem to have been considered. Another side-effect of this design is that scsi host numbers used by iscsi are never reused, thereby making rollover more likely. This patch