On Wed, Sep 13, 2017 at 08:36:10PM -0700, Philip Guenther wrote:
> On Wed, 13 Sep 2017, Patrick Wildt wrote:
> > I think softraid is leaking vnodes.  When taking a device offline with 
> > bioctl -O /dev/sd0a sd2, then wiping the disk with dd (including the 
> > disklabel), I cannot change sd0's disklabel as it would say "open part- 
> > ition would change/shrink".  This is because on assembly (and rebuild) 
> > the device is VOP_OPEN()d, but never closed.
> > 
> > With this diff, whenever a disk goes offline (I/O error or bioctl -O), 
> > we actively close the vnode.  One thing I wonder is, this still works 
> > when the backing device has already detached (USB drive being pulled).
> 
> The logic of this idea makes sense to me, though I cannot confirm the 
> placement of these bits.  Joel?
> 
> I will note that the exact same chunk of non-trivial code in four 
> different places certainly calls for a function.  Indeed, if the inside of 
> the 'if' was a function ("sr_entry_close"?), that could be reused in 
> sr_chunks_unwind()...and the XXX comment there moves to this new function.
> 
> 
> Philip Guenther
> 

Yep, agreed, that calls for a function.  Especially since that piece was
copied from sr_chunks_unwind() and is now used a few times.  Will send a
new diff with that changed as soon as Joel commented on this as well.

Thanks,
Patrick

Reply via email to