mountd(8) basically does the following:
getmntinfo() for each mount delete_exports
using nmount(2) to do the creation/deletion
of individual exports.
This works ok inside a prison, since getmntinfo()
only returns mounts visible within the prison and
the fspath argument to nmount(2) only works for
mounts within the prison's directory tree.
However, for prison0, this is a problem, since
getmntinfo() returns all mounts, including ones
in prisons.
By using a single bit in mnt_flag to indicate if a
export was done from within a prison, the addition
and deletion of exports done within a prison can
be avoided by mountd(8) when runniing in prison0
and vice versa.
This allows mountd(8) to be run both within prison(s)
and in prison0.
A more complex patch would be required to record
exactly which prison did the exports and I do not
believe that level of detail is needed at this time.