[tip: irq/core] genirq/procfs: Correctly set file permissions for affinity control files

tip-bot2 for Jeff Xie
2024-08-27T12:02:36Z

Commit-ID: 92f9d825b12fa3f6c14b42405489880d0694c96f
Gitweb: https://git.kernel.org/tip/92f9d825b12fa3f6c14b42405489880d0694c96f
Author: Jeff Xie <jeff.xie@linux.dev>
AuthorDate: Sun, 25 Aug 2024 21:19:11 +08:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 27 Aug 2024 13:54:15 +02:00

genirq/procfs: Correctly set file permissions for affinity control files

The kernel already knows at the time of interrupt allocation whether
affinity of an interrupt can be controlled by userspace or not.

It still creates all related procfs control files with read/write
permissions. That's inconsistent and non-intuitive for system
administrators and tools.

Therefore set the file permissions to read-only for such interrupts.

[ tglx: Massage change log ]

Signed-off-by: Jeff Xie <jeff.xie@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240825131911.107119-1-jeff.xie@linux.dev
---
kernel/irq/proc.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 8cccdf4..dcf8190 100644