Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/raidframe



On 02 Jan 2016, at 17:07, Christos Zoulas <christos%astron.com@localhost> wrote:
> 
> In article <20160102160001.C978DFBB5%cvs.NetBSD.org@localhost>,
> Michael van Elst <source-changes-d%NetBSD.org@localhost> 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 - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)



Home | Main Index | Thread Index | Old Index