On 02 Jan 2016, at 17:07, Christos Zoulas <chris...@astron.com> wrote:
> 
> In article <20160102160001.c978df...@cvs.netbsd.org>,
> Michael van Elst <source-changes-d@NetBSD.org> wrote:
>> @@ -2665,11 +2664,7 @@ raidread_component_area(dev_t dev, struc
>>      bp->b_flags |= B_READ;
>>      bp->b_resid = dsize;
>> 
>> -    bdev = bdevsw_lookup(bp->b_dev);
>> -    if (bdev == NULL)
>> -            return (ENXIO);
>> -    (*bdev->d_strategy)(bp);
>> -
>> +    bdev_strategy(bp);
>>      error = biowait(bp);
> 
> Don't you want instead?
> 
> +     bdev_strategy(bp);
> +     if (bp->b_error)
> +             return bp->b_error;
> 
> Since bdev_strategy() calls biodone()

Where does it call biodone()?

From sys/kern/subr_devsw.c:

void
bdev_strategy(struct buf *bp)
{
        const struct bdevsw *d;
        int mpflag;

        if ((d = bdevsw_lookup(bp->b_dev)) == NULL) {
                bp->b_error = ENXIO;
                bp->b_resid = bp->b_bcount;
                biodone_vfs(bp); /* biodone() iff vfs present */
                return;
        }

        DEV_LOCK(d);
        (*d->d_strategy)(bp);
        DEV_UNLOCK(d);
}

> and I am pretty sure you are not
> supposed to call biowait() on a biodone()'d buffer? And bdev_strategy
> should be made to return an error...
> 
> christos
> 

--
J. Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig (Germany)

Reply via email to