Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Dec 2024 18:44:53 -0800
From:      Rick Macklem <rick.macklem@gmail.com>
To:        FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Module variable initialization
Message-ID:  <CAM5tNy74ZC3FMTBWB1qj_LEhs_mv9ZXw-1SCs3rt=dLx1tkAKQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

Bugzilla pr#282156 reports a crash that appears to be caused by
a NFS client variable (nfscbd_pool) not being initialized when a
NFS mount is done.

Now, the NFS client module (nfscl.ko) is weird in that it has
two definitions for the module. There is a VFS_SET() one for
the file system and a separate DECLARE_MODULE() for nfscl.
(The latter exists so that the module can refuse to unload and
define dependencies on other modules.)

The variable (nfscbd_pool) is initialized in the modevent() function
for nfscl in the MOD_LOAD section.

Does anyone know if this can somehow result in the variable not
being initialized when an NFS mount occurs?

And, if the above is possible, would doing the initialization in the
vfs_init function for VFS_SET() be guaranteed to happen before
a mount is done?

Thanks for any help with this, rick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM5tNy74ZC3FMTBWB1qj_LEhs_mv9ZXw-1SCs3rt=dLx1tkAKQ>