[FreeNAS] Two htp2720sgl in FreeNAS

As you can see there is a bug that makes this card act as a multipath when run in pairs. I got a FreeNAS developer to look at it. They added the hack, it worked great until I rebuilt the NAS. I do not understand why this is not working now, as in the code it should just add 1 to the other card and not 0. Can anyone point me in the right way?

Hacky workaround

It is known that at least some HPT controller have a bug in the camcontrol devlist output with multiple controllers, all controllers will be presented with the same driver with index 0 e.g. two hpt27xx0 instead of hpt27xx0 and hpt27xx1

What we do here is increase the controller id by its order of appearance in the camcontrol output """
Code:
        hptctlr = defaultdict(int)

        re_drv_cid = re.compile(r'.* on (?P<drv>.*?)(?P<cid>[0-9]+) bus', re.S|re.M)
        re_tgt = re.compile(r'target (?P<tgt>[0-9]+) .*?lun (?P<lun>[0-9]+) .*\((?P<dv1>[a-z]+[0-9]+),(?P<dv2>[a-z]+[0-9]+)\)', re.S|re.M)
        drv, cid, tgt, lun, dev, devtmp = (None, ) * 6

        proc = self.__pipeopen("camcontrol devlist -v")
        for line in proc.communicate()[0].splitlines():
            if not line.startswith('<'):
                reg = re_drv_cid.search(line)
                if not reg:
                    continue
                drv = reg.group("drv")
                if drv.startswith("hpt"):
                    cid = hptctlr[drv]
                    hptctlr[drv] += 1
                else:
                    cid = reg.group("cid")
 
Back
Top