[PATCH v6 03/13] mm/demotion: Return error on write to numa_demotion sysfs

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

 



With CONFIG_MIGRATION disabled return EINVAL on write.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxx>
---
 mm/memory-tiers.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
index 9c6b40d7e0bf..c3123a457d90 100644
--- a/mm/memory-tiers.c
+++ b/mm/memory-tiers.c
@@ -105,6 +105,9 @@ static ssize_t numa_demotion_enabled_store(struct kobject *kobj,
 {
 	ssize_t ret;
 
+	if (!IS_ENABLED(CONFIG_MIGRATION))
+		return -EINVAL;
+
 	ret = kstrtobool(buf, &numa_demotion_enabled);
 	if (ret)
 		return ret;
-- 
2.36.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux