From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755150AbaC0KX3 (ORCPT ); Thu, 27 Mar 2014 06:23:29 -0400 Received: from mail-ee0-f54.google.com ([74.125.83.54]:60746 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166AbaC0KX1 (ORCPT ); Thu, 27 Mar 2014 06:23:27 -0400 Date: Thu, 27 Mar 2014 13:19:31 +0300 From: Sergey Senozhatsky To: "James E.J. Bottomley" Cc: Hannes Reinecke , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [linux-next] scsi_attach_vpd() warning at mm/page_alloc.c:2497 Message-ID: <20140327101734.GA7022@swordfish.minsk.epam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, [ 1.971778] ------------[ cut here ]------------ [ 1.971960] WARNING: CPU: 1 PID: 6 at mm/page_alloc.c:2497 __alloc_pages_nodemask+0x1b9/0x693() [ 1.972246] Modules linked in: sd_mod ahci [ 1.972604] CPU: 1 PID: 6 Comm: kworker/u8:0 Not tainted 3.14.0-rc8-next-20140327-dbg-dirty #202 [ 1.972890] Hardware name: Acer Aspire 5741G /Aspire 5741G , BIOS V1.20 02/08/2011 [ 1.973182] Workqueue: events_unbound async_run_entry_fn [ 1.973417] 0000000000000000 ffff8801534d5af0 ffffffff813ad822 0000000000000000 [ 1.973994] ffff8801534d5b28 ffffffff8103c03c ffffffff810ad4e5 00000000001000d0 [ 1.974529] ffffffff81656fc8 0000000000000000 ffffffff81656fc0 ffff8801534d5b38 [ 1.975125] Call Trace: [ 1.975306] [] dump_stack+0x4e/0x7a [ 1.975488] [] warn_slowpath_common+0x75/0x8e [ 1.975670] [] ? __alloc_pages_nodemask+0x1b9/0x693 [ 1.975853] [] warn_slowpath_null+0x15/0x17 [ 1.976035] [] __alloc_pages_nodemask+0x1b9/0x693 [ 1.976220] [] ? console_unlock+0x2dd/0x2fa [ 1.976404] [] ? scsi_execute_req_flags+0x9c/0xb3 [ 1.976587] [] __get_free_pages+0x12/0x3f [ 1.976771] [] __kmalloc+0x37/0x112 [ 1.976951] [] scsi_attach_vpd+0x41/0x1a8 [ 1.977133] [] scsi_probe_and_add_lun+0x8ec/0xa21 [ 1.977317] [] __scsi_add_device+0xce/0x10a [ 1.977501] [] ata_scsi_scan_host+0x60/0x142 [ 1.977683] [] async_port_probe+0x45/0x4a [ 1.977873] [] async_run_entry_fn+0x5a/0x110 [ 1.978061] [] process_one_work+0x1c9/0x2e9 [ 1.978243] [] worker_thread+0x1d3/0x2bd [ 1.978424] [] ? rescuer_thread+0x27d/0x27d [ 1.978606] [] kthread+0xd6/0xde [ 1.978786] [] ? kthread_create_on_node+0x162/0x162 [ 1.978970] [] ret_from_fork+0x7c/0xb0 [ 1.979151] [] ? kthread_create_on_node+0x162/0x162 [ 1.979334] ---[ end trace ca7c5bd74b0dca21 ]--- scsi_attach_vpd() (at pg0 label) attempts to firstly allocate 255 and later 134217730 bytes. --- general question, scsi_attach_vpd() is sure that scsi_vpd_inquiry() returns `ret < 0' in case of an error and `ret > 0' otherwise: "Returns size of the vpd page on success or a negative error number." while this is not exactly true. scsi_vpd_inquiry() indeed can return -EINVAL, but usually it returns scsi_execute_req()->scsi_execute_req_flags()->scsi_execute() status, which has different error indication and can be, e.g. for failed blk_get_request() in scsi_execute() or failed sense kzalloc() in scsi_execute_req_flags(), `DRIVER_ERROR << 24'. -ss