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



2008/9/13 Antti Kantee <pooka%cs.hut.fi@localhost>:
> Once again not really on the point here, but still a little mistake ...
>
> On Fri Sep 12 2008 at 05:36:49 +0200, Juan RP wrote:
>>       error = bdevvp(dev, &vp);
>>       if (error) {
>>               kmem_free(adv, sizeof(struct ataraid_disk_vnode));
>>               return NULL;
>>       }
>>       error = VOP_OPEN(vp, FREAD|FWRITE, NOCRED);
>>       if (error) {
>>               vput(vp);
>>               kmem_free(adv, sizeof(struct ataraid_disk_vnode));
>>               return NULL;
>>       }
>>       error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
>>       if (error) {
>>               vrele(vp);
>>               kmem_free(adv, sizeof(struct ataraid_disk_vnode));
>>               return NULL;
>>       }
>>       VOP_UNLOCK(vp, 0);
>
> Hope you don't have any errors ;)
>
> (and, imho, LK_RETRY shouldn't check for return value)

Thanks, will correct the code.


Home | Main Index | Thread Index | Old Index