diff options
author | Peter Zijlstra <peterz@infradead.org> | 2023-11-22 13:07:56 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2023-11-23 18:08:31 +0300 |
commit | 388a1fb7da6aaa1970c7e2a7d7fcd983a87a8484 (patch) | |
tree | 69443ff91c3445fb988d4e592754d80b22fa5e2a /kernel/events | |
parent | bbb968696d0f3442ab823598def3b756cf4735c6 (diff) | |
download | linux-388a1fb7da6aaa1970c7e2a7d7fcd983a87a8484.tar.xz |
perf: Fix the nr_addr_filters fix
Thomas reported that commit 652ffc2104ec ("perf/core: Fix narrow
startup race when creating the perf nr_addr_filters sysfs file") made
the entire attribute group vanish, instead of only the nr_addr_filters
attribute.
Additionally a stray return.
Insufficient coffee was involved with both writing and merging the
patch.
Fixes: 652ffc2104ec ("perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file")
Reported-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Link: https://lkml.kernel.org/r/20231122100756.GP8262@noisy.programming.kicks-ass.net
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 4f0c45ab8d7d..59b332cce9e7 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -11417,12 +11417,10 @@ static umode_t pmu_dev_is_visible(struct kobject *kobj, struct attribute *a, int struct device *dev = kobj_to_dev(kobj); struct pmu *pmu = dev_get_drvdata(dev); - if (!pmu->nr_addr_filters) + if (n == 2 && !pmu->nr_addr_filters) return 0; return a->mode; - - return 0; } static struct attribute_group pmu_dev_attr_group = { |