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-prev] [day] [month] [year] [list]
Date:	Sun, 22 Dec 2013 21:54:28 -0800
From:	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>
To:	Fengguang Wu <fengguang.wu@...el.com>
Cc:	LKP <fnstml-lkp@...fujitsu.com>, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
	Christoph Hellwig <hch@....de>
Subject: Re: [scsi-mq] WARNING: CPU: 0 PID: 99 at block/elevator.c:193
 elevator_init()

On Mon, 2013-12-23 at 11:16 +0800, Fengguang Wu wrote:
> Greetings,
> 
> I got the below dmesg and the first bad commit is
> 
> commit 29ff818720ce09b044652b83e9c70ef474800d54
> Author:     Nicholas Bellinger <nab@...ux-iscsi.org>
> AuthorDate: Thu May 23 22:11:38 2013 -0700
> Commit:     Nicholas Bellinger <nab@...ux-iscsi.org>
> CommitDate: Sun Dec 22 13:00:48 2013 +0000
> 
>     scsi-debug: Enable scsi-mq operation
>     
>     v4 changes:
>       - Bump can_queue to 64 for performance testing
>       - Enable scsi-mq DIF support
>       - Add nop_fs_io module parameter for performance testing
>     
>     Signed-off-by: Nicholas Bellinger <nab@...ux-iscsi.org>
> 
> +-----------------------------------------------------+----+
> |                                                     |    |
> +-----------------------------------------------------+----+
> | boot_successes                                      | 0  |
> | boot_failures                                       | 19 |
> | WARNING:CPU:PID:at_block/elevator.c:elevator_init() | 19 |
> +-----------------------------------------------------+----+
> 
> [    4.763205]   CPU 1 -> Queue 0
> [    4.764566] ------------[ cut here ]------------
> [    4.764566] ------------[ cut here ]------------
> [    4.765951] WARNING: CPU: 0 PID: 99 at block/elevator.c:193 elevator_init+0xf0/0xfb()
> 
> Attached are the full dmesg and kconfig.
> 

Mmm, so elevator_init() is now expecting q->sysfs_lock to be held after:

commit eb1c160b22655fd4ec44be732d6594fd1b1e44f4
Author: Tomoki Sekiyama <tomoki.sekiyama@....com>
Date:   Tue Oct 15 16:42:16 2013 -0600

    elevator: Fix a race in elevator switching and md device initialization

Adding the following scsi_mq_alloc_queue() patch to quiet this warning.

Thanks Fengguang!

--nab

diff --git a/drivers/scsi/scsi-mq.c b/drivers/scsi/scsi-mq.c
index dad720a..188509d 100644
--- a/drivers/scsi/scsi-mq.c
+++ b/drivers/scsi/scsi-mq.c
@@ -151,7 +151,7 @@ int scsi_mq_alloc_queue(struct Scsi_Host *sh, struct scsi_device *sdev)
        struct request_queue *q;
        struct request *rq;
        struct scsi_cmnd *sc;
-       int i, j, sgl_size;
+       int i, j, rc, sgl_size;
        bool prot = true;
 
        sdev->sdev_mq_reg.ops = &scsi_mq_ops;
@@ -181,8 +181,11 @@ int scsi_mq_alloc_queue(struct Scsi_Host *sh, struct scsi_device *sdev)
 
        q->sg_reserved_size = INT_MAX;
 
-       if (elevator_init(q, NULL)) {
-               dump_stack();
+       mutex_lock(&q->sysfs_lock);
+       rc = elevator_init(q, NULL);
+       mutex_unlock(&q->sysfs_lock);
+       if (rc) {
+               pr_err("elevator_init failed for scsi-mq: %d\n", rc);
                return -ENOMEM;
        }
        /*


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ