lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 9 Jun 2022 13:00:28 +0800
From:   Guan Jing <guanjing6@...wei.com>
To:     <naoya.horiguchi@....com>, <linmiaohe@...wei.com>,
        <akpm@...ux-foundation.org>
CC:     <djwong@...nel.org>, <dan.j.williams@...el.com>,
        <ruansy.fnst@...itsu.com>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>, Guan Jing <guanjing6@...wei.com>
Subject: [PATCH -next] mm:fix build error of defined but not used

If CONFIG_HUGETLB_PAGE is not set and CONFIG_FS_DAX=y.
Use command "make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-" to
build, will fail:

mm/memory-failure.c:568:13: error: ‘collect_procs_fsdax’ defined
but not used [-Werror=unused-function]
	static void collect_procs_fsdax(struct page *page,
             ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [mm/memory-failure.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [mm] Error 2
make: *** Waiting for unfinished jobs....

so extending "#ifdef CONFIG_HUGETLB_PAG" to cover
collect_procs_fsdax() would be a simple resolution.

Reported-by: Hulk Robot <hulkci@...wei.com>
Fixes: 143ac5cd7289 ("mm: introduce mf_dax_kill_procs() for fsdax case")
Signed-off-by: Guan Jing <guanjing6@...wei.com>
---
 mm/memory-failure.c | 56 ++++++++++++++++++++++-----------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 545f402c4890..952f117e4584 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -561,34 +561,6 @@ static void collect_procs_file(struct page *page, struct list_head *to_kill,
 	i_mmap_unlock_read(mapping);
 }
 
-#ifdef CONFIG_FS_DAX
-/*
- * Collect processes when the error hit a fsdax page.
- */
-static void collect_procs_fsdax(struct page *page,
-		struct address_space *mapping, pgoff_t pgoff,
-		struct list_head *to_kill)
-{
-	struct vm_area_struct *vma;
-	struct task_struct *tsk;
-
-	i_mmap_lock_read(mapping);
-	read_lock(&tasklist_lock);
-	for_each_process(tsk) {
-		struct task_struct *t = task_early_kill(tsk, true);
-
-		if (!t)
-			continue;
-		vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) {
-			if (vma->vm_mm == t->mm)
-				add_to_kill(t, page, pgoff, vma, to_kill);
-		}
-	}
-	read_unlock(&tasklist_lock);
-	i_mmap_unlock_read(mapping);
-}
-#endif /* CONFIG_FS_DAX */
-
 /*
  * Collect the processes who have the corrupted page mapped to kill.
  */
@@ -1540,6 +1512,34 @@ static int try_to_split_thp_page(struct page *page, const char *msg)
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
+#ifdef CONFIG_FS_DAX
+/*
+ * Collect processes when the error hit a fsdax page.
+ */
+static void collect_procs_fsdax(struct page *page,
+		struct address_space *mapping, pgoff_t pgoff,
+		struct list_head *to_kill)
+{
+	struct vm_area_struct *vma;
+	struct task_struct *tsk;
+
+	i_mmap_lock_read(mapping);
+	read_lock(&tasklist_lock);
+	for_each_process(tsk) {
+		struct task_struct *t = task_early_kill(tsk, true);
+
+		if (!t)
+			continue;
+		vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) {
+			if (vma->vm_mm == t->mm)
+				add_to_kill(t, page, pgoff, vma, to_kill);
+		}
+	}
+	read_unlock(&tasklist_lock);
+	i_mmap_unlock_read(mapping);
+}
+#endif /* CONFIG_FS_DAX */
+
 /*
  * Called from hugetlb code with hugetlb_lock held.
  *
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ