<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi/device_handler, branch v4.9.16</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>scsi: scsi_dh_alua: Fix a reference counting bug</title>
<updated>2016-11-01T17:32:24+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-11-01T14:19:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=df3d422cbac685da882e4c239dfda07de33d431b'/>
<id>df3d422cbac685da882e4c239dfda07de33d431b</id>
<content type='text'>
The code at the end of alua_rtpg_work() is as follows:

	scsi_device_put(sdev);
	kref_put(&amp;pg-&gt;kref, release_port_group);

In other words, alua_rtpg_queue() must hold an sdev reference and a pg
reference before queueing rtpg work. If no rtpg work is queued no
additional references should be held when alua_rtpg_queue() returns. If
no rtpg work is queued, ensure that alua_rtpg_queue() only gives up the
sdev reference if that reference was obtained by the same
alua_rtpg_queue() call.

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Reported-by: Tang Junhui &lt;tang.junhui@zte.com.cn&gt;
Cc: Hannes Reinecke &lt;hare@suse.com&gt;
Cc: Tang Junhui &lt;tang.junhui@zte.com.cn&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code at the end of alua_rtpg_work() is as follows:

	scsi_device_put(sdev);
	kref_put(&amp;pg-&gt;kref, release_port_group);

In other words, alua_rtpg_queue() must hold an sdev reference and a pg
reference before queueing rtpg work. If no rtpg work is queued no
additional references should be held when alua_rtpg_queue() returns. If
no rtpg work is queued, ensure that alua_rtpg_queue() only gives up the
sdev reference if that reference was obtained by the same
alua_rtpg_queue() call.

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Reported-by: Tang Junhui &lt;tang.junhui@zte.com.cn&gt;
Cc: Hannes Reinecke &lt;hare@suse.com&gt;
Cc: Tang Junhui &lt;tang.junhui@zte.com.cn&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: scsi_dh_alua: fix missing kref_put() in alua_rtpg_work()</title>
<updated>2016-11-01T17:31:08+00:00</updated>
<author>
<name>tang.junhui</name>
<email>tang.junhui@zte.com.cn</email>
</author>
<published>2016-10-28T07:54:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1fdd14279eab2e9f79745631379f0c53cb8f9a5a'/>
<id>1fdd14279eab2e9f79745631379f0c53cb8f9a5a</id>
<content type='text'>
Reference count of pg leaks in alua_rtpg_work() since kref_put() is not
called to decrease the reference count of pg when the condition
pg-&gt;rtpg_sdev==NULL satisfied (actually it is easy to satisfy), it would
cause memory of pg leakage.

Signed-off-by: tang.junhui &lt;tang.junhui@zte.com.cn&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reference count of pg leaks in alua_rtpg_work() since kref_put() is not
called to decrease the reference count of pg when the condition
pg-&gt;rtpg_sdev==NULL satisfied (actually it is easy to satisfy), it would
cause memory of pg leakage.

Signed-off-by: tang.junhui &lt;tang.junhui@zte.com.cn&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: scsi_dh_alua: Fix memory leak in alua_rtpg()</title>
<updated>2016-09-27T00:42:38+00:00</updated>
<author>
<name>tang.junhui</name>
<email>tang.junhui@zte.com.cn</email>
</author>
<published>2016-09-18T10:05:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=086acff2cf8a6a41f533e5da5f51923db5f68df4'/>
<id>086acff2cf8a6a41f533e5da5f51923db5f68df4</id>
<content type='text'>
buff should be freed before returning with SCSI_DH_RETRY in alua_rtpg().

Signed-off-by: tang.junhui &lt;tang.junhui@zte.com.cn&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
buff should be freed before returning with SCSI_DH_RETRY in alua_rtpg().

Signed-off-by: tang.junhui &lt;tang.junhui@zte.com.cn&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'fixes' into misc</title>
<updated>2016-05-18T01:12:50+00:00</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2016-05-18T01:12:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e7ca7f9fa2cda220ba807620c992ce77c33a32ea'/>
<id>e7ca7f9fa2cda220ba807620c992ce77c33a32ea</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi_dh_alua: do not fail for unknown VPD identification</title>
<updated>2016-05-11T01:31:17+00:00</updated>
<author>
<name>Hannes Reinecke</name>
<email>hare@suse.de</email>
</author>
<published>2016-05-06T08:34:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fe8b9534a0a0356f8a76467e2c561194bdb53c84'/>
<id>fe8b9534a0a0356f8a76467e2c561194bdb53c84</id>
<content type='text'>
Not every device will return a useable VPD identification, but still
might support ALUA. Rather than disable ALUA support we should be
allowing the device identification to be empty and attach individual
ALUA device handler to each devices.

[mkp: Fixed typo reported by Bart]

Reported-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Signed-off-by: Hannes Reinecke &lt;hare@suse.com&gt;
Tested-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Reviewed-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not every device will return a useable VPD identification, but still
might support ALUA. Rather than disable ALUA support we should be
allowing the device identification to be empty and attach individual
ALUA device handler to each devices.

[mkp: Fixed typo reported by Bart]

Reported-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Signed-off-by: Hannes Reinecke &lt;hare@suse.com&gt;
Tested-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Reviewed-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi_dh_alua: uninitialized variable in alua_rtpg()</title>
<updated>2016-04-30T16:24:50+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-04-14T18:20:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a4bd85203190990ad808abbd4a5dc848a950002c'/>
<id>a4bd85203190990ad808abbd4a5dc848a950002c</id>
<content type='text'>
It's possible to use "err" without initializing it.  If it happens to be
a 2 which is SCSI_DH_RETRY then that could cause a bug.  Bart Van Assche
pointed out that we should probably re-initialize it for every iteration
through the retry loop.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Hannes Reinicke &lt;hare@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: James Bottomley &lt;jejb@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's possible to use "err" without initializing it.  If it happens to be
a 2 which is SCSI_DH_RETRY then that could cause a bug.  Bart Van Assche
pointed out that we should probably re-initialize it for every iteration
through the retry loop.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Hannes Reinicke &lt;hare@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: James Bottomley &lt;jejb@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi_dh_alua: Declare local functions static</title>
<updated>2016-04-15T20:53:19+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-04-14T17:27:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1f275f976fdc04bf1bfd06929d10852b1b05decc'/>
<id>1f275f976fdc04bf1bfd06929d10852b1b05decc</id>
<content type='text'>
This patch avoids that building with W=1 causes gcc to report the
following type of warning:

    no previous prototype for ... [-Wmissing-prototypes]

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Reviewed-by: Hannes Reinicke &lt;hare@suse.de&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Ewan Milne &lt;emilne@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch avoids that building with W=1 causes gcc to report the
following type of warning:

    no previous prototype for ... [-Wmissing-prototypes]

Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Reviewed-by: Hannes Reinicke &lt;hare@suse.de&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Ewan Milne &lt;emilne@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi_dh_alua: Fix a recently introduced deadlock</title>
<updated>2016-03-30T00:32:02+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@sandisk.com</email>
</author>
<published>2016-03-28T18:14:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=38c315992338a6c26050477b50700e0f8e08ff96'/>
<id>38c315992338a6c26050477b50700e0f8e08ff96</id>
<content type='text'>
While retesting the SRP initiator I ran the command "rmmod mlx4_ib"
while I/O was in progress. That command triggers SCSI device removal
indirectly. Avoid that this action triggers the following deadlock:

=================================
[ INFO: inconsistent lock state ]
4.6.0-rc0-dbg+ #2 Tainted: G           O
---------------------------------
inconsistent {IN-SOFTIRQ-W} -&gt; {SOFTIRQ-ON-W} usage.
multipathd/484 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (&amp;(&amp;pg-&gt;lock)-&gt;rlock){+.?...}, at: [&lt;ffffffffa04f50a2&gt;] alua_bus_detach+0x52/0xa0 [scsi_dh_alua]
{IN-SOFTIRQ-W} state was registered at:
  [&lt;ffffffff810a64a9&gt;] __lock_acquire+0x7e9/0x1ad0
  [&lt;ffffffff810a7fd0&gt;] lock_acquire+0x60/0x80
  [&lt;ffffffff8159910e&gt;] _raw_spin_lock_irqsave+0x3e/0x60
  [&lt;ffffffffa04f5131&gt;] alua_rtpg_queue+0x41/0x1d0 [scsi_dh_alua]
  [&lt;ffffffffa04f5531&gt;] alua_check+0xe1/0x220 [scsi_dh_alua]
  [&lt;ffffffffa04f5709&gt;] alua_check_sense+0x99/0xb0 [scsi_dh_alua]
  [&lt;ffffffff813f0d01&gt;] scsi_check_sense+0x71/0x3f0
  [&lt;ffffffff813f2f8b&gt;] scsi_decide_disposition+0x18b/0x1d0
  [&lt;ffffffff813f6e52&gt;] scsi_softirq_done+0x52/0x140
  [&lt;ffffffff812a26f2&gt;] blk_done_softirq+0x52/0x90
  [&lt;ffffffff8105bc1f&gt;] __do_softirq+0x10f/0x230
  [&lt;ffffffff8105bec8&gt;] irq_exit+0xa8/0xb0
  [&lt;ffffffff8101a675&gt;] do_IRQ+0x65/0x110
  [&lt;ffffffff8159a2c9&gt;] ret_from_intr+0x0/0x19
  [&lt;ffffffff811732f1&gt;] kmem_cache_alloc+0x151/0x190
  [&lt;ffffffff8118e534&gt;] create_object+0x34/0x2d0
  [&lt;ffffffff8158eaa6&gt;] kmemleak_alloc_percpu+0x56/0xd0
  [&lt;ffffffff8113ab0d&gt;] pcpu_alloc+0x38d/0x660
  [&lt;ffffffff8113aded&gt;] __alloc_percpu_gfp+0xd/0x10
  [&lt;ffffffff812e56a5&gt;] __percpu_counter_init+0x55/0xb0
  [&lt;ffffffff812b4989&gt;] blkg_alloc+0x79/0x230
  [&lt;ffffffff812b6756&gt;] blkcg_init_queue+0x26/0x1d0
  [&lt;ffffffff81297eed&gt;] blk_alloc_queue_node+0x27d/0x2e0
  [&lt;ffffffffa017766c&gt;] dm_create+0x20c/0x570 [dm_mod]
  [&lt;ffffffffa017e356&gt;] dev_create+0x56/0x2c0 [dm_mod]
  [&lt;ffffffffa017dcae&gt;] ctl_ioctl+0x26e/0x520 [dm_mod]
  [&lt;ffffffffa017df6e&gt;] dm_ctl_ioctl+0xe/0x20 [dm_mod]
  [&lt;ffffffff811aa8ee&gt;] do_vfs_ioctl+0x8e/0x660
  [&lt;ffffffff811aaefc&gt;] SyS_ioctl+0x3c/0x70
  [&lt;ffffffff81599929&gt;] entry_SYSCALL_64_fastpath+0x1c/0xac
irq event stamp: 4290931
hardirqs last  enabled at (4290931): [ 1662.892772]
[&lt;ffffffff81599341&gt;] _raw_spin_unlock_irqrestore+0x31/0x50
hardirqs last disabled at (4290930): [&lt;ffffffff815990e7&gt;] _raw_spin_lock_irqsave+0x17/0x60
softirqs last  enabled at (4290774): [&lt;ffffffff8105bcdb&gt;] __do_softirq+0x1cb/0x230
softirqs last disabled at (4289831): [&lt;ffffffff8105bec8&gt;] irq_exit+0xa8/0xb0

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;pg-&gt;lock)-&gt;rlock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;pg-&gt;lock)-&gt;rlock);

 *** DEADLOCK ***

2 locks held by multipathd/484:
 #0:  (&amp;bdev-&gt;bd_mutex){+.+.+.}, at: [&lt;ffffffff811d1cc3&gt;] __blkdev_put+0x33/0x360
 #1:  (sd_ref_mutex){+.+...}, at: [&lt;ffffffff81400afc&gt;] scsi_disk_put+0x1c/0x40

stack backtrace:
CPU: 6 PID: 484 Comm: multipathd Tainted: G           O    4.6.0-rc0-dbg+ #2
Call Trace:
 [&lt;ffffffff812bd115&gt;] dump_stack+0x67/0x92
 [&lt;ffffffff810a5175&gt;] print_usage_bug+0x215/0x240
 [&lt;ffffffff810a56ea&gt;] mark_lock+0x54a/0x610
 [&lt;ffffffff810a6505&gt;] __lock_acquire+0x845/0x1ad0
 [&lt;ffffffff810a7fd0&gt;] lock_acquire+0x60/0x80
 [&lt;ffffffff81598f23&gt;] _raw_spin_lock+0x33/0x50
 [&lt;ffffffffa04f50a2&gt;] alua_bus_detach+0x52/0xa0 [scsi_dh_alua]
 [&lt;ffffffff813ff6f7&gt;] scsi_dh_release_device+0x17/0x50
 [&lt;ffffffff813fb8da&gt;] scsi_device_dev_release_usercontext+0x2a/0x120
 [&lt;ffffffff810701f0&gt;] execute_in_process_context+0x80/0x90
 [&lt;ffffffff813fb8a7&gt;] scsi_device_dev_release+0x17/0x20
 [&lt;ffffffff813c8cfd&gt;] device_release+0x2d/0x90
 [&lt;ffffffff812bfa8a&gt;] kobject_release+0x7a/0x190
 [&lt;ffffffff812bf946&gt;] kobject_put+0x26/0x50
 [&lt;ffffffff813c8ee2&gt;] put_device+0x12/0x20
 [&lt;ffffffff813edc86&gt;] scsi_device_put+0x26/0x30
 [&lt;ffffffff81400b0d&gt;] scsi_disk_put+0x2d/0x40
 [&lt;ffffffff81400b68&gt;] sd_release+0x48/0xb0
 [&lt;ffffffff811d1f2e&gt;] __blkdev_put+0x29e/0x360
 [&lt;ffffffff811d24b9&gt;] blkdev_put+0x49/0x170
 [&lt;ffffffff811d2600&gt;] blkdev_close+0x20/0x30
 [&lt;ffffffff81198f48&gt;] __fput+0xe8/0x1f0
 [&lt;ffffffff81199089&gt;] ____fput+0x9/0x10
 [&lt;ffffffff81075d9e&gt;] task_work_run+0x6e/0xa0
 [&lt;ffffffff81001119&gt;] exit_to_usermode_loop+0xa9/0xb0
 [&lt;ffffffff81001590&gt;] syscall_return_slowpath+0xb0/0xc0
 [&lt;ffffffff815999b7&gt;] entry_SYSCALL_64_fastpath+0xaa/0xac

Fixes: cb0a168cb6b8 (scsi_dh_alua: update 'access_state' field)
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Reviewed-by: Hannes Reinicke &lt;hare@suse.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Ewan Milne &lt;emilne@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While retesting the SRP initiator I ran the command "rmmod mlx4_ib"
while I/O was in progress. That command triggers SCSI device removal
indirectly. Avoid that this action triggers the following deadlock:

=================================
[ INFO: inconsistent lock state ]
4.6.0-rc0-dbg+ #2 Tainted: G           O
---------------------------------
inconsistent {IN-SOFTIRQ-W} -&gt; {SOFTIRQ-ON-W} usage.
multipathd/484 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (&amp;(&amp;pg-&gt;lock)-&gt;rlock){+.?...}, at: [&lt;ffffffffa04f50a2&gt;] alua_bus_detach+0x52/0xa0 [scsi_dh_alua]
{IN-SOFTIRQ-W} state was registered at:
  [&lt;ffffffff810a64a9&gt;] __lock_acquire+0x7e9/0x1ad0
  [&lt;ffffffff810a7fd0&gt;] lock_acquire+0x60/0x80
  [&lt;ffffffff8159910e&gt;] _raw_spin_lock_irqsave+0x3e/0x60
  [&lt;ffffffffa04f5131&gt;] alua_rtpg_queue+0x41/0x1d0 [scsi_dh_alua]
  [&lt;ffffffffa04f5531&gt;] alua_check+0xe1/0x220 [scsi_dh_alua]
  [&lt;ffffffffa04f5709&gt;] alua_check_sense+0x99/0xb0 [scsi_dh_alua]
  [&lt;ffffffff813f0d01&gt;] scsi_check_sense+0x71/0x3f0
  [&lt;ffffffff813f2f8b&gt;] scsi_decide_disposition+0x18b/0x1d0
  [&lt;ffffffff813f6e52&gt;] scsi_softirq_done+0x52/0x140
  [&lt;ffffffff812a26f2&gt;] blk_done_softirq+0x52/0x90
  [&lt;ffffffff8105bc1f&gt;] __do_softirq+0x10f/0x230
  [&lt;ffffffff8105bec8&gt;] irq_exit+0xa8/0xb0
  [&lt;ffffffff8101a675&gt;] do_IRQ+0x65/0x110
  [&lt;ffffffff8159a2c9&gt;] ret_from_intr+0x0/0x19
  [&lt;ffffffff811732f1&gt;] kmem_cache_alloc+0x151/0x190
  [&lt;ffffffff8118e534&gt;] create_object+0x34/0x2d0
  [&lt;ffffffff8158eaa6&gt;] kmemleak_alloc_percpu+0x56/0xd0
  [&lt;ffffffff8113ab0d&gt;] pcpu_alloc+0x38d/0x660
  [&lt;ffffffff8113aded&gt;] __alloc_percpu_gfp+0xd/0x10
  [&lt;ffffffff812e56a5&gt;] __percpu_counter_init+0x55/0xb0
  [&lt;ffffffff812b4989&gt;] blkg_alloc+0x79/0x230
  [&lt;ffffffff812b6756&gt;] blkcg_init_queue+0x26/0x1d0
  [&lt;ffffffff81297eed&gt;] blk_alloc_queue_node+0x27d/0x2e0
  [&lt;ffffffffa017766c&gt;] dm_create+0x20c/0x570 [dm_mod]
  [&lt;ffffffffa017e356&gt;] dev_create+0x56/0x2c0 [dm_mod]
  [&lt;ffffffffa017dcae&gt;] ctl_ioctl+0x26e/0x520 [dm_mod]
  [&lt;ffffffffa017df6e&gt;] dm_ctl_ioctl+0xe/0x20 [dm_mod]
  [&lt;ffffffff811aa8ee&gt;] do_vfs_ioctl+0x8e/0x660
  [&lt;ffffffff811aaefc&gt;] SyS_ioctl+0x3c/0x70
  [&lt;ffffffff81599929&gt;] entry_SYSCALL_64_fastpath+0x1c/0xac
irq event stamp: 4290931
hardirqs last  enabled at (4290931): [ 1662.892772]
[&lt;ffffffff81599341&gt;] _raw_spin_unlock_irqrestore+0x31/0x50
hardirqs last disabled at (4290930): [&lt;ffffffff815990e7&gt;] _raw_spin_lock_irqsave+0x17/0x60
softirqs last  enabled at (4290774): [&lt;ffffffff8105bcdb&gt;] __do_softirq+0x1cb/0x230
softirqs last disabled at (4289831): [&lt;ffffffff8105bec8&gt;] irq_exit+0xa8/0xb0

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;pg-&gt;lock)-&gt;rlock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;pg-&gt;lock)-&gt;rlock);

 *** DEADLOCK ***

2 locks held by multipathd/484:
 #0:  (&amp;bdev-&gt;bd_mutex){+.+.+.}, at: [&lt;ffffffff811d1cc3&gt;] __blkdev_put+0x33/0x360
 #1:  (sd_ref_mutex){+.+...}, at: [&lt;ffffffff81400afc&gt;] scsi_disk_put+0x1c/0x40

stack backtrace:
CPU: 6 PID: 484 Comm: multipathd Tainted: G           O    4.6.0-rc0-dbg+ #2
Call Trace:
 [&lt;ffffffff812bd115&gt;] dump_stack+0x67/0x92
 [&lt;ffffffff810a5175&gt;] print_usage_bug+0x215/0x240
 [&lt;ffffffff810a56ea&gt;] mark_lock+0x54a/0x610
 [&lt;ffffffff810a6505&gt;] __lock_acquire+0x845/0x1ad0
 [&lt;ffffffff810a7fd0&gt;] lock_acquire+0x60/0x80
 [&lt;ffffffff81598f23&gt;] _raw_spin_lock+0x33/0x50
 [&lt;ffffffffa04f50a2&gt;] alua_bus_detach+0x52/0xa0 [scsi_dh_alua]
 [&lt;ffffffff813ff6f7&gt;] scsi_dh_release_device+0x17/0x50
 [&lt;ffffffff813fb8da&gt;] scsi_device_dev_release_usercontext+0x2a/0x120
 [&lt;ffffffff810701f0&gt;] execute_in_process_context+0x80/0x90
 [&lt;ffffffff813fb8a7&gt;] scsi_device_dev_release+0x17/0x20
 [&lt;ffffffff813c8cfd&gt;] device_release+0x2d/0x90
 [&lt;ffffffff812bfa8a&gt;] kobject_release+0x7a/0x190
 [&lt;ffffffff812bf946&gt;] kobject_put+0x26/0x50
 [&lt;ffffffff813c8ee2&gt;] put_device+0x12/0x20
 [&lt;ffffffff813edc86&gt;] scsi_device_put+0x26/0x30
 [&lt;ffffffff81400b0d&gt;] scsi_disk_put+0x2d/0x40
 [&lt;ffffffff81400b68&gt;] sd_release+0x48/0xb0
 [&lt;ffffffff811d1f2e&gt;] __blkdev_put+0x29e/0x360
 [&lt;ffffffff811d24b9&gt;] blkdev_put+0x49/0x170
 [&lt;ffffffff811d2600&gt;] blkdev_close+0x20/0x30
 [&lt;ffffffff81198f48&gt;] __fput+0xe8/0x1f0
 [&lt;ffffffff81199089&gt;] ____fput+0x9/0x10
 [&lt;ffffffff81075d9e&gt;] task_work_run+0x6e/0xa0
 [&lt;ffffffff81001119&gt;] exit_to_usermode_loop+0xa9/0xb0
 [&lt;ffffffff81001590&gt;] syscall_return_slowpath+0xb0/0xc0
 [&lt;ffffffff815999b7&gt;] entry_SYSCALL_64_fastpath+0xaa/0xac

Fixes: cb0a168cb6b8 (scsi_dh_alua: update 'access_state' field)
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Reviewed-by: Hannes Reinicke &lt;hare@suse.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Ewan Milne &lt;emilne@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi_dh_alua: uninitialized variable in alua_check_vpd()</title>
<updated>2016-03-15T01:04:59+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-03-11T11:19:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=100bcb851b8ce09824215cfc2afd661ae8d454c9'/>
<id>100bcb851b8ce09824215cfc2afd661ae8d454c9</id>
<content type='text'>
The pg_updated variable is support to be set to false at the start but
it is uninitialized.

Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Hannes Reinicke &lt;hare@suse.de&gt;
Reviewed-by: Manoj Kumar &lt;manoj@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The pg_updated variable is support to be set to false at the start but
it is uninitialized.

Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Hannes Reinicke &lt;hare@suse.de&gt;
Reviewed-by: Manoj Kumar &lt;manoj@linux.vnet.ibm.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi_dh_emc: update 'access_state' field</title>
<updated>2016-03-05T22:20:33+00:00</updated>
<author>
<name>Hannes Reinecke</name>
<email>hare@suse.de</email>
</author>
<published>2016-03-03T06:54:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0323375c8bc5c101c9284856cac19a0b9ece71d4'/>
<id>0323375c8bc5c101c9284856cac19a0b9ece71d4</id>
<content type='text'>
Update the 'access_state' field of the SCSI device whenever the path
state changes.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update the 'access_state' field of the SCSI device whenever the path
state changes.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
