knotes and force unmount

Matthew Fleming matthew.fleming at isilon.com
Wed Mar 4 15:31:48 PST 2009


At close() time knote_fdclose() will take care of any outstanding knotes
for the file by looping over the list, calling kn_fop->f_detach and then
knote_drop().  For a umount -f, there may still be open files; these
will be handled in vgonel() by a call to VOP_CLOSE().  knotes are
untouched in this case.

If the filesystem is from a loadable module, then the knotes need to be
cleaned up before the module is unloaded to prevent a callout into code
that no longer exists, when the file is later closed.  So it seems like
there is code missing from vgonel() that should be doing this for the
case where it calls VOP_CLOSE().  I realize this isn't a problem for ufs
(never unloaded because it's used for /) and NFS (no events), but for
any other filesystem this seems like a hole in the force unmount story.

Is this interpretation correct?  It would always be possible to add code
to a filesystem's vop_close routine or its unmount routine, but
architecturally this seems like something that should be handled at
vgonel->VOP_CLOSE time, because it's a problem for any loadable
filesystem with events.

Thanks,
matthew


More information about the freebsd-arch mailing list