camcontrol rescan all fails if there is no bus 0

Andriy Gapon avg at icyb.net.ua
Sun Oct 31 19:16:36 UTC 2010


on 31/10/2010 16:10 Ed Maste said the following:
> On Tue, Oct 26, 2010 at 10:41:11AM -0600, Scott Long wrote:
> 
>> Ok, I guess I need to see if CAM_XPT_PATH_ID can get returned from the
>> devmatch.
> 
> Is that not handled by this code that parses the returned XPT_DEV_MATCH
> results in in reset_or_rescan_bus:
> 
>     for (i = 0; i < matchccb.cdm.num_matches; i++) {
>             struct bus_match_result *bus_result;
> 
> ...
> 
>             bus_result = &matchccb.cdm.matches[i].result.bus_result;
> 
>             /*
>              * We don't want to rescan or reset the xpt bus.
>              * See above.
>              */
>             if ((int)bus_result->path_id == -1)
>                     continue;
> 
> That is, we do the actual rescan only on legitimate busses after the
> XPT_DEV_MATCH ioctl returns.
> 
>> What happens with this patch if you run it with no real buses
>> registered (i.e. cam module present, but no SIMs present)?
> 
>  From the user's perspective, with the stock camcontrol and no
> registered busses I get: 
> 
> [root at edlaptop ~]# camcontrol rescan all
> camcontrol: CAMIOCOMMAND ioctl failed: Invalid argument
> 
> With the patch:
> 
> [root at edlaptop ~]# ./camcontrol rescan all
> [root at edlaptop ~]#
> 
> And then with a umass device attached:
> 
> [root at edlaptop ~]# ./camcontrol rescan all
> Re-scan of bus 0 was successful

Can you test a synthetic situation where you have e.g. bus 1, but no bus 0 ?
E.g. by having two umass devices connected during boot and then removing one of
them.

-- 
Andriy Gapon


More information about the freebsd-scsi mailing list