tech-kern archive

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

Re: vnode lock and v_numoutput



On Mon, Jan 26, 2015 at 07:33:18PM +0000, Taylor R Campbell wrote:
>    Date: Mon, 26 Jan 2015 20:04:17 +0100
>    From: Manuel Bouyer <bouyer%antioche.eu.org@localhost>
> 
>    On Mon, Jan 26, 2015 at 06:54:35PM +0000, Taylor R Campbell wrote:
>    > However, I think there's a bug in your new patch too: suppose VOP_BMAP
>    > fails on one of the middle blocks -- then we won't call VOP_STRATEGY
>    > for the last block even if VOP_BMAP succeeds for that block.
> 
>    AFAIK that can't happen: if VOP_BMAP fails for a middle block, error
>    will be != 0 and we exit the loop:
> 
> OK, I didn't look that closely.  In that case, your patch looks good
> to me, although I'd put a KASSERT(0 < b->b_resid) before the loop just
> to be safe.
> 
> We should probably do the same thing in genfs_do_io and anywhere else
> that uses nestiobuf for writes, and invent a better way to express the
> nestiobuf API so it's less ridiculously error-prone.

Yes, I'll look at this (but I don't know why it does +2 here).
But I guess genfs_do_io() is safe as is: it's probably called
with the vnode locked, as VOP_BMAP() is called without taking and
releasing the lock.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index