On Mon, 18 Jun 2001 10:19:19 -0500,
Dean Roehrich <roehrich@xxxxxxx> wrote:
>>From: Keith Owens <kaos@xxxxxxxxxxxxxxxxx>
>>init_xfs_fs() calls dmapi_init() which does MOD_INC_USE_COUNT. Compile
>>XFS without DMAPI support and your problem will disappear.
>>The module related code in dmapi is a hangover from a time when dmapi
>>was a module in its own right instead of being linked into xfs.o. I
>>will remove module related code from dmapi, I will also review grio, to
>>make sure it does not have the same problem.
>No, it's not a hangover. It was put there last week to keep the reference
>count up. If you've been using DMAPI then you cannot allow the module to be
>unloaded unless DMAPI says it's okay. DMAPI won't say it's okay unless it's
>clear that no HSMs are using it (whether or not any XFS filesystems are
>mounted, an HSM could still be there, watching the DMAPI queues, waiting for
>one to be mounted.)
>DMAPI needs a way to say that the XFS module is busy--I thought
>MOD_INC_USE_COUNT was the proper method. If dm_uninit() is giving false
>positives then that's another issue entirely.
dmapi needs to bump the module use count when it provides services to
another piece of code, not at init time. MOD_INC_USE_COUNT is the
correct method but dmapi_init is the wrong place. Find a point where
dmapi starts providing services and put MOD_INC_USE_COUNT there,
probably dmapi_open. Same for MOD_DEC_USE_COUNT.