xfs
[Top] [All Lists]

Re: XFS module problems -- usage count incorrect

To: linux-xfs@xxxxxxxxxxx
Subject: Re: XFS module problems -- usage count incorrect
From: Dean Roehrich <roehrich@xxxxxxx>
Date: Tue, 19 Jun 2001 09:59:25 -0500
Sender: owner-linux-xfs@xxxxxxxxxxx
>From:  Keith Owens <kaos@xxxxxxxxxxxxxxxxx>

>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.

dmapi_open() is where the HSM comes in.  That's one place where we could bump
the count.  We also have event threads coming in, when someone mounts with "-o
dmapi" and we'd have to bump the count in that place, too, because that event
thread might come in before an HSM is started.  Then we'd no longer know how
many times we've bumped it, unless we kept our own counter.  It seems so much
more obvious--to me--to just bump it, and then during the module unload check
to see if there are any registered filesystems or sessions before dropping the
reference.

It's not yet clear to me that there was a bug :) If the person who reported
the unload problem was using dmapi and didn't clean up their sessions then I
cannot let them unload the module--it wouldn't matter where we bumped and
dropped reference counts.  Is that person still following this thread?

Dean

<Prev in Thread] Current Thread [Next in Thread>