Thread (14 messages) 14 messages, 3 authors, 2021-05-12

Re: [PATCH 3/8] mm/debug: Factor PagePoisoned out of __dump_page

From: Kefeng Wang <hidden>
Date: 2021-05-12 03:53:29
Also in: linux-fsdevel


On 2021/5/12 11:38, Matthew Wilcox wrote:
On Wed, May 12, 2021 at 11:29:06AM +0800, Kefeng Wang wrote:
quoted
quoted
   void dump_page(struct page *page, const char *reason)
   {
-	__dump_page(page, reason);
+	if (PagePoisoned(page))
+		pr_warn("page:%p is uninitialized and poisoned", page);
+	else
+		__dump_page(page);
Hi Matthew, dump_page_owenr() should be called when !PagePoisoned, right?

quoted
+	if (reason)
+		pr_warn("page dumped because: %s\n", reason);
   	dump_page_owner(page);
   }
   EXPORT_SYMBOL(dump_page);
dump_page_owner() is called whether the page is Poisoned or not ...
both before and after this patch.  Is there a problem with that?
struct page_ext *page_ext = lookup_page_ext(page);

   unsigned long pfn = page_to_pfn(page);
   struct mem_section *section = __pfn_to_section(pfn);
   if (!section->page_ext)

If page is Poisoned, I guess the section maybe NULL,
so section->page_ext may meet NULL pointer dereference,
is it possible?

.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help