Commit 388a1fb7 authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

perf: Fix the nr_addr_filters fix



Thomas reported that commit 652ffc21 ("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: 652ffc21 ("perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file")
Reported-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Link: https://lkml.kernel.org/r/20231122100756.GP8262@noisy.programming.kicks-ass.net
parent bbb96869
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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 = {