Re: [PATCH v2] [BUGFIX] drivers/base: fix show_mem_removable tohandle missing sections

From: Russ Anderson
Date: Tue Aug 27 2013 - 12:06:33 EST


On Mon, Aug 26, 2013 at 02:49:59PM -0700, Andrew Morton wrote:
> On Fri, 23 Aug 2013 11:23:17 -0500 Russ Anderson <rja@xxxxxxx> wrote:
>
> > "cat /sys/devices/system/memory/memory*/removable" crashed the system.
> >
> > The problem is that show_mem_removable() is passing a
> > bad pfn to is_mem_section_removable(), which causes
> > if (!node_online(page_to_nid(page))) to blow up.
> > Why is it passing in a bad pfn?
> >
> > show_mem_removable() will loop sections_per_block times.
> > sections_per_block is 16, but mem->section_count is 8,
> > indicating holes in this memory block. Checking that
> > the memory section is present before checking to see
> > if the memory section is removable fixes the problem.
>
> The patch textually applies to 3.10, 3.9 and perhaps earlier. Should
> it be applied to earlier kernels?

I believe so, since this does not appear to be a recent
regression, but have not verified the problem/fix in
earlier kernels.

Thanks,
--
Russ Anderson, OS RAS/Partitioning Project Lead
SGI - Silicon Graphics Inc rja@xxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/