tech-kern archive

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

Re: ataraid(4) and VOP_OPENing the same block device



Not exactly what you asked for, but:

On Tue Aug 26 2008 at 05:24:33 +0200, Juan Romero Pardines wrote:
>                 error = bdevvp(dev, &vp);
>                 if (error)
>                         break;
>                 error = VOP_OPEN(vp, FREAD|FWRITE, NOCRED);
>                 if (error) {
>                         vput(vp);
>                         /*
>                          * XXX This is bogus.  We should just mark the
>                          * XXX component as FAILED, and write-back new
>                          * XXX config blocks.
>                          */
>                         break;
>                 }
> 
>                 VOP_UNLOCK(vp, 0);

That code is incorrect: bdevvp() does not return a locked vnode.
You should vn_lock() it before proceeding.


Home | Main Index | Thread Index | Old Index