summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/procfs.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index e22bee26..5abe011d 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-03 Mark Wielaard <mjw@redhat.com>
+
+ * procfs.c (_stp_rmdir_proc_module): Usage count warning
+ depends on kernel version.
+
2008-10-02 Tim Moore <timoore@redhat.com>
* addr-map.c (add_bad_addr_entry): Fix bugs in allocating a new
diff --git a/runtime/procfs.c b/runtime/procfs.c
index 1b1d5447..8aeda14c 100644
--- a/runtime/procfs.c
+++ b/runtime/procfs.c
@@ -24,15 +24,22 @@ static struct proc_dir_entry *_stp_proc_root = NULL;
void _stp_close_procfs(void);
+// 2.6.24 fixed proc_dir_entry refcounting.
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+#define LAST_ENTRY_COUNT 0
+#else
+#define LAST_ENTRY_COUNT 1
+#endif
+
/*
* Removes /proc/systemtap/{module_name} and /proc/systemtap (if empty)
*/
void _stp_rmdir_proc_module(void)
{
if (_stp_proc_root && _stp_proc_root->subdir == NULL) {
- if (atomic_read(&_stp_proc_root->count))
- _stp_warn("Removal of /proc/systemtap/%s\nis deferred until it is no longer in use.\n"
- "Systemtap module removal will block.\n", THIS_MODULE->name);
+ if (atomic_read(&_stp_proc_root->count) != LAST_ENTRY_COUNT)
+ _stp_warn("(%d,%d)Removal of /proc/systemtap/%s\nis deferred until it is no longer in use.\n"
+ "Systemtap module removal will block.\n", atomic_read(&_stp_proc_root->count), LAST_ENTRY_COUNT, THIS_MODULE->name);
remove_proc_entry(THIS_MODULE->name, _stp_proc_stap);
_stp_proc_root = NULL;
}