Page MenuHomeFreeBSD

Fix panic in GEOM on forced devfs unmount
ClosedPublic

Authored by trasz on Jul 11 2015, 10:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 1 2024, 12:59 PM
Unknown Object (File)
Oct 1 2024, 12:55 PM
Unknown Object (File)
Sep 27 2024, 1:17 PM
Unknown Object (File)
Sep 22 2024, 3:27 PM
Unknown Object (File)
Sep 19 2024, 11:18 AM
Unknown Object (File)
Sep 19 2024, 8:55 AM
Unknown Object (File)
Sep 19 2024, 2:20 AM
Unknown Object (File)
Sep 18 2024, 8:49 AM
Subscribers

Details

Summary

Fix panic that would happen on forcibly unmounting devfs (note
that as it is now, devfs ignores MNT_FORCE anyway, so it needs
to be modified to trigger the panic) with consumers still opened.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz retitled this revision from to Fix panic in GEOM on forced devfs unmount.
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)

I am not sure it is a proper place for workaround. Rather then documenting bug of vgonel(9), it should better be fixed. IMHO it is pointless to call VOP_CLOSE() without flags same as VOP_OPEN().

Konstantin, do you see a way to do this in a better way? In particular, is there any way for vgonel() to somehow retrieve the original file open flags (eg FREAD), or doesn't it make any sense, since it operates at vnode level and not file level?

In D3050#62312, @trasz wrote:

Konstantin, do you see a way to do this in a better way? In particular, is there any way for vgonel() to somehow retrieve the original file open flags (eg FREAD), or doesn't it make any sense, since it operates at vnode level and not file level?

It is not pointless to call VOP_CLOSE() there, but it is also impossible to provide read/write flags. VOP_CLOSE() is helpful for filesystems which track opens vs close, like NFSv4. On the other hand, indeed we have no idea about the amount of readers or writers, since this information is kept at the file, and not vnode, level.

Well, there is v_writecount information for the vnode, but it is not directly mapped to the w counter. And there is no way to recover the r.

BTW, in the context of this patch, it causes the leakage of the r/w/e counters, am I right ?

In D3050#62365, @kib wrote:

BTW, in the context of this patch, it causes the leakage of the r/w/e counters, am I right ?

In GEOM close() with zero counter triggers assertion. With proposed patch it will be a NOP, i.e. cause a leak.

So, can anyone propose a better way? Otherwise I'd like to commit it as is.

This revision was automatically updated to reflect the committed changes.