• M
    block: initialize request_queue's numa node during · 5151412d
    Mike Snitzer 提交于
    struct request_queue is allocated with __GFP_ZERO so its "node" field is
    zero before initialization.  This causes an oops if node 0 is offline in
    the page allocator because its zonelists are not initialized.  From Dave
    Young's dmesg:
    
    	SRAT: Node 1 PXM 2 0-d0000000
    	SRAT: Node 1 PXM 2 100000000-330000000
    	SRAT: Node 0 PXM 1 330000000-630000000
    	Initmem setup node 1 0000000000000000-000000000affb000
    	...
    	Built 1 zonelists in Node order, mobility grouping on.
    	...
    	BUG: unable to handle kernel paging request at 0000000000001c08
    	IP: [<ffffffff8111c355>] __alloc_pages_nodemask+0xb5/0x870
    
    and __alloc_pages_nodemask+0xb5 translates to a NULL pointer on
    zonelist->_zonerefs.
    
    The fix is to initialize q->node at the time of allocation so the correct
    node is passed to the slab allocator later.
    
    Since blk_init_allocated_queue_node() is no longer needed, merge it with
    blk_init_allocated_queue().
    
    [rientjes@google.com: changelog, initializing q->node]
    Cc: stable@vger.kernel.org [2.6.37+]
    Reported-by: NDave Young <dyoung@redhat.com>
    Signed-off-by: NMike Snitzer <snitzer@redhat.com>
    Signed-off-by: NDavid Rientjes <rientjes@google.com>
    Tested-by: NDave Young <dyoung@redhat.com>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    5151412d
blkdev.h 39.2 KB