tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Locking strategy for device deletion (also see PR kern/48536)



On Wed, 8 Jun 2016, Michael van Elst wrote:

paul%whooppee.com@localhost (Paul Goyette) writes:

See misfs/specfs/spec_vnops.c::spec_close().

yes, that would certainly explain the situation.  It does, however, make
it rather difficult to maintain a valid ref-count!

specfs does the open refcounting. The device only has a single bit, open
sets it and close clears it. That bit is added to a common counter
that is used for other references.

Hmmm. Would it be valid, then, for my close() routine to reset the ref-count to zero rather than simply decrementing? Does the close() only get called if there are _NO_ outstanding open()s for _any_ process?



+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


Home | Main Index | Thread Index | Old Index