<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/block/nbd.c, branch v3.2.11</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>nbd-replace-some-printk-with-dev_warn-and-dev_info-checkpatch-fixes</title>
<updated>2011-08-19T12:48:28+00:00</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2011-08-19T12:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=548ef6cc26ca1c81f19855d57d3fb0f9a7ce3385'/>
<id>548ef6cc26ca1c81f19855d57d3fb0f9a7ce3385</id>
<content type='text'>
ERROR: code indent should use tabs where possible
#30: FILE: drivers/block/nbd.c:578:
+^I        dev_info(disk_to_dev(lo-&gt;disk), "NBD_DISCONNECT\n");$

total: 1 errors, 0 warnings, 35 lines checked

NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
      scripts/cleanfile

./patches/nbd-replace-some-printk-with-dev_warn-and-dev_info.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Cc: WANG Cong &lt;amwang@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ERROR: code indent should use tabs where possible
#30: FILE: drivers/block/nbd.c:578:
+^I        dev_info(disk_to_dev(lo-&gt;disk), "NBD_DISCONNECT\n");$

total: 1 errors, 0 warnings, 35 lines checked

NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
      scripts/cleanfile

./patches/nbd-replace-some-printk-with-dev_warn-and-dev_info.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Cc: WANG Cong &lt;amwang@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: replace some printk with dev_warn() and dev_info()</title>
<updated>2011-08-19T12:48:28+00:00</updated>
<author>
<name>WANG Cong</name>
<email>amwang@redhat.com</email>
</author>
<published>2011-08-19T12:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5eedf5415cd57f8db8642a5db4cf8e5507390030'/>
<id>5eedf5415cd57f8db8642a5db4cf8e5507390030</id>
<content type='text'>
Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: lower the loglevel of an error message</title>
<updated>2011-08-19T12:48:28+00:00</updated>
<author>
<name>WANG Cong</name>
<email>amwang@redhat.com</email>
</author>
<published>2011-08-19T12:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7742ce4ab49976851ce7f0185dcbe491935371a2'/>
<id>7742ce4ab49976851ce7f0185dcbe491935371a2</id>
<content type='text'>
This is only an error, no need to use KERN_CRIT log level.

Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is only an error, no need to use KERN_CRIT log level.

Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: replace printk KERN_ERR with dev_err()</title>
<updated>2011-08-19T12:48:22+00:00</updated>
<author>
<name>WANG Cong</name>
<email>amwang@redhat.com</email>
</author>
<published>2011-08-19T12:48:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7f1b90f99a2d4253f8eb1221d39da072178adbc5'/>
<id>7f1b90f99a2d4253f8eb1221d39da072178adbc5</id>
<content type='text'>
Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: replace sysfs_create_file() with device_create_file()</title>
<updated>2011-08-19T12:48:21+00:00</updated>
<author>
<name>WANG Cong</name>
<email>amwang@redhat.com</email>
</author>
<published>2011-08-19T12:48:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1695b87f7dd152b866f0dd867c8e599025fc4965'/>
<id>1695b87f7dd152b866f0dd867c8e599025fc4965</id>
<content type='text'>
Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: use task_pid_nr() to get current pid</title>
<updated>2011-08-19T12:48:17+00:00</updated>
<author>
<name>WANG Cong</name>
<email>amwang@redhat.com</email>
</author>
<published>2011-08-19T12:48:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=25ac0c2b971235d3e8c7af0b6889a1eb6988b559'/>
<id>25ac0c2b971235d3e8c7af0b6889a1eb6988b559</id>
<content type='text'>
Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: adjust 'max_part' according to part_shift</title>
<updated>2011-05-28T12:44:46+00:00</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-28T12:44:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5988ce239682854d4e632fb58bff000700830394'/>
<id>5988ce239682854d4e632fb58bff000700830394</id>
<content type='text'>
The 'max_part' parameter determines how many partitions are supported
on each nbd device. However the actual number can be changed to the
power of 2 minus 1 form during the module initialization as
alloc_disk() is called with (1 &lt;&lt; part_shift) for some reason.

So adjust 'max_part' also at least for consistency with loop and brd.
It is exported via sysfs already, and a user should check this value
after module loading if [s]he wants to use that number correctly
(i.e. fdisk or something).

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Laurent Vivier &lt;Laurent.Vivier@bull.net&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The 'max_part' parameter determines how many partitions are supported
on each nbd device. However the actual number can be changed to the
power of 2 minus 1 form during the module initialization as
alloc_disk() is called with (1 &lt;&lt; part_shift) for some reason.

So adjust 'max_part' also at least for consistency with loop and brd.
It is exported via sysfs already, and a user should check this value
after module loading if [s]he wants to use that number correctly
(i.e. fdisk or something).

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Laurent Vivier &lt;Laurent.Vivier@bull.net&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: limit module parameters to a sane value</title>
<updated>2011-05-28T12:44:46+00:00</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-28T12:44:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3b2710824e00d238554c13b5add347e6c701ab1a'/>
<id>3b2710824e00d238554c13b5add347e6c701ab1a</id>
<content type='text'>
The 'max_part' parameter controls the number of maximum partition
a nbd device can have. However if a user specifies very large
value it would exceed the limitation of device minor number and
can cause a kernel oops (or, at least, produce invalid device
nodes in some cases).

In addition, specifying large 'nbds_max' value causes same
problem for the same reason.

On my desktop, following command results to the kernel bug:

$ sudo modprobe nbd max_part=100000
 kernel BUG at /media/Linux_Data/project/linux/fs/sysfs/group.c:65!
 invalid opcode: 0000 [#1] SMP
 last sysfs file: /sys/devices/virtual/block/nbd4/range
 CPU 1
 Modules linked in: nbd(+) bridge stp llc kvm_intel kvm asus_atk0110 sg sr_mod cdrom

 Pid: 2522, comm: modprobe Tainted: G        W   2.6.39-leonard+ #159 System manufacturer System Product Name/P5G41TD-M PRO
 RIP: 0010:[&lt;ffffffff8115aa08&gt;]  [&lt;ffffffff8115aa08&gt;] internal_create_group+0x2f/0x166
 RSP: 0018:ffff8801009f1de8  EFLAGS: 00010246
 RAX: 00000000ffffffef RBX: ffff880103920478 RCX: 00000000000a7bd3
 RDX: ffffffff81a2dbe0 RSI: 0000000000000000 RDI: ffff880103920478
 RBP: ffff8801009f1e38 R08: ffff880103920468 R09: ffff880103920478
 R10: ffff8801009f1de8 R11: ffff88011eccbb68 R12: ffffffff81a2dbe0
 R13: ffff880103920468 R14: 0000000000000000 R15: ffff880103920400
 FS:  00007f3c49de9700(0000) GS:ffff88011f800000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 00007f3b7fe7c000 CR3: 00000000cd58d000 CR4: 00000000000406e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process modprobe (pid: 2522, threadinfo ffff8801009f0000, task ffff8801009a93a0)
 Stack:
  ffff8801009f1e58 ffffffff812e8f6e ffff8801009f1e58 ffffffff812e7a80
  ffff880000000010 ffff880103920400 ffff8801002fd0c0 ffff880103920468
  0000000000000011 ffff880103920400 ffff8801009f1e48 ffffffff8115ab6a
 Call Trace:
  [&lt;ffffffff812e8f6e&gt;] ? device_add+0x4f1/0x5e4
  [&lt;ffffffff812e7a80&gt;] ? dev_set_name+0x41/0x43
  [&lt;ffffffff8115ab6a&gt;] sysfs_create_group+0x13/0x15
  [&lt;ffffffff810b857e&gt;] blk_trace_init_sysfs+0x14/0x16
  [&lt;ffffffff811ee58b&gt;] blk_register_queue+0x4c/0xfd
  [&lt;ffffffff811f3bdf&gt;] add_disk+0xe4/0x29c
  [&lt;ffffffffa007e2ab&gt;] nbd_init+0x2ab/0x30d [nbd]
  [&lt;ffffffffa007e000&gt;] ? 0xffffffffa007dfff
  [&lt;ffffffff8100020f&gt;] do_one_initcall+0x7f/0x13e
  [&lt;ffffffff8107ab0a&gt;] sys_init_module+0xa1/0x1e3
  [&lt;ffffffff814f3542&gt;] system_call_fastpath+0x16/0x1b
 Code: 41 57 41 56 41 55 41 54 53 48 83 ec 28 0f 1f 44 00 00 48 89 fb 41 89 f6 49 89 d4 48 85 ff 74 0b 85 f6 75 0b 48 83
  7f 30 00 75 14 &lt;0f&gt; 0b eb fe b9 ea ff ff ff 48 83 7f 30 00 0f 84 09 01 00 00 49
 RIP  [&lt;ffffffff8115aa08&gt;] internal_create_group+0x2f/0x166
  RSP &lt;ffff8801009f1de8&gt;
 ---[ end trace 753285ffbf72c57c ]---

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Laurent Vivier &lt;Laurent.Vivier@bull.net&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The 'max_part' parameter controls the number of maximum partition
a nbd device can have. However if a user specifies very large
value it would exceed the limitation of device minor number and
can cause a kernel oops (or, at least, produce invalid device
nodes in some cases).

In addition, specifying large 'nbds_max' value causes same
problem for the same reason.

On my desktop, following command results to the kernel bug:

$ sudo modprobe nbd max_part=100000
 kernel BUG at /media/Linux_Data/project/linux/fs/sysfs/group.c:65!
 invalid opcode: 0000 [#1] SMP
 last sysfs file: /sys/devices/virtual/block/nbd4/range
 CPU 1
 Modules linked in: nbd(+) bridge stp llc kvm_intel kvm asus_atk0110 sg sr_mod cdrom

 Pid: 2522, comm: modprobe Tainted: G        W   2.6.39-leonard+ #159 System manufacturer System Product Name/P5G41TD-M PRO
 RIP: 0010:[&lt;ffffffff8115aa08&gt;]  [&lt;ffffffff8115aa08&gt;] internal_create_group+0x2f/0x166
 RSP: 0018:ffff8801009f1de8  EFLAGS: 00010246
 RAX: 00000000ffffffef RBX: ffff880103920478 RCX: 00000000000a7bd3
 RDX: ffffffff81a2dbe0 RSI: 0000000000000000 RDI: ffff880103920478
 RBP: ffff8801009f1e38 R08: ffff880103920468 R09: ffff880103920478
 R10: ffff8801009f1de8 R11: ffff88011eccbb68 R12: ffffffff81a2dbe0
 R13: ffff880103920468 R14: 0000000000000000 R15: ffff880103920400
 FS:  00007f3c49de9700(0000) GS:ffff88011f800000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 00007f3b7fe7c000 CR3: 00000000cd58d000 CR4: 00000000000406e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process modprobe (pid: 2522, threadinfo ffff8801009f0000, task ffff8801009a93a0)
 Stack:
  ffff8801009f1e58 ffffffff812e8f6e ffff8801009f1e58 ffffffff812e7a80
  ffff880000000010 ffff880103920400 ffff8801002fd0c0 ffff880103920468
  0000000000000011 ffff880103920400 ffff8801009f1e48 ffffffff8115ab6a
 Call Trace:
  [&lt;ffffffff812e8f6e&gt;] ? device_add+0x4f1/0x5e4
  [&lt;ffffffff812e7a80&gt;] ? dev_set_name+0x41/0x43
  [&lt;ffffffff8115ab6a&gt;] sysfs_create_group+0x13/0x15
  [&lt;ffffffff810b857e&gt;] blk_trace_init_sysfs+0x14/0x16
  [&lt;ffffffff811ee58b&gt;] blk_register_queue+0x4c/0xfd
  [&lt;ffffffff811f3bdf&gt;] add_disk+0xe4/0x29c
  [&lt;ffffffffa007e2ab&gt;] nbd_init+0x2ab/0x30d [nbd]
  [&lt;ffffffffa007e000&gt;] ? 0xffffffffa007dfff
  [&lt;ffffffff8100020f&gt;] do_one_initcall+0x7f/0x13e
  [&lt;ffffffff8107ab0a&gt;] sys_init_module+0xa1/0x1e3
  [&lt;ffffffff814f3542&gt;] system_call_fastpath+0x16/0x1b
 Code: 41 57 41 56 41 55 41 54 53 48 83 ec 28 0f 1f 44 00 00 48 89 fb 41 89 f6 49 89 d4 48 85 ff 74 0b 85 f6 75 0b 48 83
  7f 30 00 75 14 &lt;0f&gt; 0b eb fe b9 ea ff ff ff 48 83 7f 30 00 0f 84 09 01 00 00 49
 RIP  [&lt;ffffffff8115aa08&gt;] internal_create_group+0x2f/0x166
  RSP &lt;ffff8801009f1de8&gt;
 ---[ end trace 753285ffbf72c57c ]---

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Laurent Vivier &lt;Laurent.Vivier@bull.net&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: pass MSG_* flags to kernel_recvmsg()</title>
<updated>2011-05-28T12:44:46+00:00</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-05-28T12:44:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=35fbf5bcf497d6ddbe7b6478141e7526d1474ff5'/>
<id>35fbf5bcf497d6ddbe7b6478141e7526d1474ff5</id>
<content type='text'>
Unlike kernel_sendmsg(), kernel_recvmsg() requires passing flags explicitly
via last parameter instead of struct msghdr.msg_flags. Therefore calls to
sock_xmit(lo, 0, ..., MSG_WAITALL) have not been processed properly by tcp
layer wrt. the flag. Fix it.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unlike kernel_sendmsg(), kernel_recvmsg() requires passing flags explicitly
via last parameter instead of struct msghdr.msg_flags. Therefore calls to
sock_xmit(lo, 0, ..., MSG_WAITALL) have not been processed properly by tcp
layer wrt. the flag. Fix it.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Paul Clements &lt;Paul.Clements@steeleye.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: remove module-level ioctl mutex</title>
<updated>2011-02-12T00:12:20+00:00</updated>
<author>
<name>Soren Hansen</name>
<email>soren@linux2go.dk</email>
</author>
<published>2011-02-10T23:01:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=de1f016f882e52facc3c8609599f827bcdd14af9'/>
<id>de1f016f882e52facc3c8609599f827bcdd14af9</id>
<content type='text'>
Commit 2a48fc0ab242417 ("block: autoconvert trivial BKL users to private
mutex") replaced uses of the BKL in the nbd driver with mutex
operations.  Since then, I've been been seeing these lock ups:

 INFO: task qemu-nbd:16115 blocked for more than 120 seconds.
 "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 qemu-nbd      D 0000000000000001     0 16115  16114 0x00000004
  ffff88007d775d98 0000000000000082 ffff88007d775fd8 ffff88007d774000
  0000000000013a80 ffff8800020347e0 ffff88007d775fd8 0000000000013a80
  ffff880133730000 ffff880002034440 ffffea0004333db8 ffffffffa071c020
 Call Trace:
  [&lt;ffffffff815b9997&gt;] __mutex_lock_slowpath+0xf7/0x180
  [&lt;ffffffff815b93eb&gt;] mutex_lock+0x2b/0x50
  [&lt;ffffffffa071a21c&gt;] nbd_ioctl+0x6c/0x1c0 [nbd]
  [&lt;ffffffff812cb970&gt;] blkdev_ioctl+0x230/0x730
  [&lt;ffffffff811967a1&gt;] block_ioctl+0x41/0x50
  [&lt;ffffffff81175c03&gt;] do_vfs_ioctl+0x93/0x370
  [&lt;ffffffff81175f61&gt;] sys_ioctl+0x81/0xa0
  [&lt;ffffffff8100c0c2&gt;] system_call_fastpath+0x16/0x1b

Instrumenting the nbd module's ioctl handler with some extra logging
clearly shows the NBD_DO_IT ioctl being invoked which is a long-lived
ioctl in the sense that it doesn't return until another ioctl asks the
driver to disconnect.  However, that other ioctl blocks, waiting for the
module-level mutex that replaced the BKL, and then we're stuck.

This patch removes the module-level mutex altogether.  It's clearly
wrong, and as far as I can see, it's entirely unnecessary, since the nbd
driver maintains per-device mutexes, and I don't see anything that would
require a module-level (or kernel-level, for that matter) mutex.

Signed-off-by: Soren Hansen &lt;soren@linux2go.dk&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Acked-by: Paul Clements &lt;paul.clements@steeleye.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: &lt;stable@kernel.org&gt;		[2.6.37.x]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 2a48fc0ab242417 ("block: autoconvert trivial BKL users to private
mutex") replaced uses of the BKL in the nbd driver with mutex
operations.  Since then, I've been been seeing these lock ups:

 INFO: task qemu-nbd:16115 blocked for more than 120 seconds.
 "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 qemu-nbd      D 0000000000000001     0 16115  16114 0x00000004
  ffff88007d775d98 0000000000000082 ffff88007d775fd8 ffff88007d774000
  0000000000013a80 ffff8800020347e0 ffff88007d775fd8 0000000000013a80
  ffff880133730000 ffff880002034440 ffffea0004333db8 ffffffffa071c020
 Call Trace:
  [&lt;ffffffff815b9997&gt;] __mutex_lock_slowpath+0xf7/0x180
  [&lt;ffffffff815b93eb&gt;] mutex_lock+0x2b/0x50
  [&lt;ffffffffa071a21c&gt;] nbd_ioctl+0x6c/0x1c0 [nbd]
  [&lt;ffffffff812cb970&gt;] blkdev_ioctl+0x230/0x730
  [&lt;ffffffff811967a1&gt;] block_ioctl+0x41/0x50
  [&lt;ffffffff81175c03&gt;] do_vfs_ioctl+0x93/0x370
  [&lt;ffffffff81175f61&gt;] sys_ioctl+0x81/0xa0
  [&lt;ffffffff8100c0c2&gt;] system_call_fastpath+0x16/0x1b

Instrumenting the nbd module's ioctl handler with some extra logging
clearly shows the NBD_DO_IT ioctl being invoked which is a long-lived
ioctl in the sense that it doesn't return until another ioctl asks the
driver to disconnect.  However, that other ioctl blocks, waiting for the
module-level mutex that replaced the BKL, and then we're stuck.

This patch removes the module-level mutex altogether.  It's clearly
wrong, and as far as I can see, it's entirely unnecessary, since the nbd
driver maintains per-device mutexes, and I don't see anything that would
require a module-level (or kernel-level, for that matter) mutex.

Signed-off-by: Soren Hansen &lt;soren@linux2go.dk&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Acked-by: Paul Clements &lt;paul.clements@steeleye.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: &lt;stable@kernel.org&gt;		[2.6.37.x]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
