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 06:54:35PM +0000, Taylor R Campbell wrote:
>    Date: Mon, 26 Jan 2015 12:10:53 +0100
>    From: Manuel Bouyer <bouyer%antioche.eu.org@localhost>
> 
>    I'm not sure I understand; the "bump v_numoutput" is always needed;
>    but if skipped is 0 the last nestiobuf_done() call is done by
>    biodone() callback and not by the called. So the bump has to happen
>    before the last buf is queued.
> 
> Ah, yes, sorry -- we need one bump for every nested buf that will be
> queued and biodone'd, and always one bump for the parent which will
> always be biodone'd either by a nested buf or by nestiobuf_done on the
> parent.
> 
> 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:
                /*
                 * If there was an error or a hole in the file...punt.
                 * Note that we may have to wait for any operations
                 * that we have already fired off before releasing
                 * the buffer.
                 *
                 * XXX we could deal with holes here but it would be
                 * a hassle (in the write case).
                 */
                if (error) {
                        skipped += resid;
                        break;
                }
so if skipped is set, the last block that was effectively VOP_BMAP()'ed
had an error and we should not VOP_STRATEGY() it.

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


Home | Main Index | Thread Index | Old Index