<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/block/nbd.c, branch linux-4.8.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>nbd: fix race in ioctl</title>
<updated>2016-08-04T20:19:16+00:00</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@oracle.com</email>
</author>
<published>2016-05-27T10:59:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=97240963eb308d8d21a89c0459822f7ea98463b4'/>
<id>97240963eb308d8d21a89c0459822f7ea98463b4</id>
<content type='text'>
Quentin ran into this bug:

WARNING: CPU: 64 PID: 10085 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x65/0x80
sysfs: cannot create duplicate filename '/devices/virtual/block/nbd3/pid'
Modules linked in: nbd
CPU: 64 PID: 10085 Comm: qemu-nbd Tainted: G      D         4.6.0+ #7
 0000000000000000 ffff8820330bba68 ffffffff814b8791 ffff8820330bbac8
 0000000000000000 ffff8820330bbab8 ffffffff810d04ab ffff8820330bbaa8
 0000001f00000296 0000000000017681 ffff8810380bf000 ffffffffa0001790
Call Trace:
 [&lt;ffffffff814b8791&gt;] dump_stack+0x4d/0x6c
 [&lt;ffffffff810d04ab&gt;] __warn+0xdb/0x100
 [&lt;ffffffff810d0574&gt;] warn_slowpath_fmt+0x44/0x50
 [&lt;ffffffff81218c65&gt;] sysfs_warn_dup+0x65/0x80
 [&lt;ffffffff81218a02&gt;] sysfs_add_file_mode_ns+0x172/0x180
 [&lt;ffffffff81218a35&gt;] sysfs_create_file_ns+0x25/0x30
 [&lt;ffffffff81594a76&gt;] device_create_file+0x36/0x90
 [&lt;ffffffffa0000e8d&gt;] __nbd_ioctl+0x32d/0x9b0 [nbd]
 [&lt;ffffffff814cc8e8&gt;] ? find_next_bit+0x18/0x20
 [&lt;ffffffff810f7c29&gt;] ? select_idle_sibling+0xe9/0x120
 [&lt;ffffffff810f6cd7&gt;] ? __enqueue_entity+0x67/0x70
 [&lt;ffffffff810f9bf0&gt;] ? enqueue_task_fair+0x630/0xe20
 [&lt;ffffffff810efa76&gt;] ? resched_curr+0x36/0x70
 [&lt;ffffffff810f0078&gt;] ? check_preempt_curr+0x78/0x90
 [&lt;ffffffff810f00a2&gt;] ? ttwu_do_wakeup+0x12/0x80
 [&lt;ffffffff810f01b1&gt;] ? ttwu_do_activate.constprop.86+0x61/0x70
 [&lt;ffffffff810f0c15&gt;] ? try_to_wake_up+0x185/0x2d0
 [&lt;ffffffff810f0d6d&gt;] ? default_wake_function+0xd/0x10
 [&lt;ffffffff81105471&gt;] ? autoremove_wake_function+0x11/0x40
 [&lt;ffffffffa0001577&gt;] nbd_ioctl+0x67/0x94 [nbd]
 [&lt;ffffffff814ac0fd&gt;] blkdev_ioctl+0x14d/0x940
 [&lt;ffffffff811b0da2&gt;] ? put_pipe_info+0x22/0x60
 [&lt;ffffffff811d96cc&gt;] block_ioctl+0x3c/0x40
 [&lt;ffffffff811ba08d&gt;] do_vfs_ioctl+0x8d/0x5e0
 [&lt;ffffffff811aa329&gt;] ? ____fput+0x9/0x10
 [&lt;ffffffff810e9092&gt;] ? task_work_run+0x72/0x90
 [&lt;ffffffff811ba627&gt;] SyS_ioctl+0x47/0x80
 [&lt;ffffffff8185f5df&gt;] entry_SYSCALL_64_fastpath+0x17/0x93
---[ end trace 7899b295e4f850c8 ]---

It seems fairly obvious that device_create_file() is not being protected
from being run concurrently on the same nbd.

Quentin found the following relevant commits:

1a2ad21 nbd: add locking to nbd_ioctl
90b8f28 [PATCH] end of methods switch: remove the old ones
d4430d6 [PATCH] beginning of methods conversion
08f8585 [PATCH] move block_device_operations to blkdev.h

It would seem that the race was introduced in the process of moving nbd
from BKL to unlocked ioctls.

By setting nbd-&gt;task_recv while the mutex is held, we can prevent other
processes from running concurrently (since nbd-&gt;task_recv is also checked
while the mutex is held).

Reported-and-tested-by: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
Cc: Markus Pargmann &lt;mpa@pengutronix.de&gt;
Cc: Paul Clements &lt;paul.clements@steeleye.com&gt;
Cc: Pavel Machek &lt;pavel@suse.cz&gt;
Cc: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Quentin ran into this bug:

WARNING: CPU: 64 PID: 10085 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x65/0x80
sysfs: cannot create duplicate filename '/devices/virtual/block/nbd3/pid'
Modules linked in: nbd
CPU: 64 PID: 10085 Comm: qemu-nbd Tainted: G      D         4.6.0+ #7
 0000000000000000 ffff8820330bba68 ffffffff814b8791 ffff8820330bbac8
 0000000000000000 ffff8820330bbab8 ffffffff810d04ab ffff8820330bbaa8
 0000001f00000296 0000000000017681 ffff8810380bf000 ffffffffa0001790
Call Trace:
 [&lt;ffffffff814b8791&gt;] dump_stack+0x4d/0x6c
 [&lt;ffffffff810d04ab&gt;] __warn+0xdb/0x100
 [&lt;ffffffff810d0574&gt;] warn_slowpath_fmt+0x44/0x50
 [&lt;ffffffff81218c65&gt;] sysfs_warn_dup+0x65/0x80
 [&lt;ffffffff81218a02&gt;] sysfs_add_file_mode_ns+0x172/0x180
 [&lt;ffffffff81218a35&gt;] sysfs_create_file_ns+0x25/0x30
 [&lt;ffffffff81594a76&gt;] device_create_file+0x36/0x90
 [&lt;ffffffffa0000e8d&gt;] __nbd_ioctl+0x32d/0x9b0 [nbd]
 [&lt;ffffffff814cc8e8&gt;] ? find_next_bit+0x18/0x20
 [&lt;ffffffff810f7c29&gt;] ? select_idle_sibling+0xe9/0x120
 [&lt;ffffffff810f6cd7&gt;] ? __enqueue_entity+0x67/0x70
 [&lt;ffffffff810f9bf0&gt;] ? enqueue_task_fair+0x630/0xe20
 [&lt;ffffffff810efa76&gt;] ? resched_curr+0x36/0x70
 [&lt;ffffffff810f0078&gt;] ? check_preempt_curr+0x78/0x90
 [&lt;ffffffff810f00a2&gt;] ? ttwu_do_wakeup+0x12/0x80
 [&lt;ffffffff810f01b1&gt;] ? ttwu_do_activate.constprop.86+0x61/0x70
 [&lt;ffffffff810f0c15&gt;] ? try_to_wake_up+0x185/0x2d0
 [&lt;ffffffff810f0d6d&gt;] ? default_wake_function+0xd/0x10
 [&lt;ffffffff81105471&gt;] ? autoremove_wake_function+0x11/0x40
 [&lt;ffffffffa0001577&gt;] nbd_ioctl+0x67/0x94 [nbd]
 [&lt;ffffffff814ac0fd&gt;] blkdev_ioctl+0x14d/0x940
 [&lt;ffffffff811b0da2&gt;] ? put_pipe_info+0x22/0x60
 [&lt;ffffffff811d96cc&gt;] block_ioctl+0x3c/0x40
 [&lt;ffffffff811ba08d&gt;] do_vfs_ioctl+0x8d/0x5e0
 [&lt;ffffffff811aa329&gt;] ? ____fput+0x9/0x10
 [&lt;ffffffff810e9092&gt;] ? task_work_run+0x72/0x90
 [&lt;ffffffff811ba627&gt;] SyS_ioctl+0x47/0x80
 [&lt;ffffffff8185f5df&gt;] entry_SYSCALL_64_fastpath+0x17/0x93
---[ end trace 7899b295e4f850c8 ]---

It seems fairly obvious that device_create_file() is not being protected
from being run concurrently on the same nbd.

Quentin found the following relevant commits:

1a2ad21 nbd: add locking to nbd_ioctl
90b8f28 [PATCH] end of methods switch: remove the old ones
d4430d6 [PATCH] beginning of methods conversion
08f8585 [PATCH] move block_device_operations to blkdev.h

It would seem that the race was introduced in the process of moving nbd
from BKL to unlocked ioctls.

By setting nbd-&gt;task_recv while the mutex is held, we can prevent other
processes from running concurrently (since nbd-&gt;task_recv is also checked
while the mutex is held).

Reported-and-tested-by: Quentin Casasnovas &lt;quentin.casasnovas@oracle.com&gt;
Cc: Markus Pargmann &lt;mpa@pengutronix.de&gt;
Cc: Paul Clements &lt;paul.clements@steeleye.com&gt;
Cc: Pavel Machek &lt;pavel@suse.cz&gt;
Cc: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-4.8/core' of git://git.kernel.dk/linux-block</title>
<updated>2016-07-26T22:03:07+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-07-26T22:03:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d05d7f40791ccbb6e543cc5dd6a6aa08fc71d635'/>
<id>d05d7f40791ccbb6e543cc5dd6a6aa08fc71d635</id>
<content type='text'>
Pull core block updates from Jens Axboe:

   - the big change is the cleanup from Mike Christie, cleaning up our
     uses of command types and modified flags.  This is what will throw
     some merge conflicts

   - regression fix for the above for btrfs, from Vincent

   - following up to the above, better packing of struct request from
     Christoph

   - a 2038 fix for blktrace from Arnd

   - a few trivial/spelling fixes from Bart Van Assche

   - a front merge check fix from Damien, which could cause issues on
     SMR drives

   - Atari partition fix from Gabriel

   - convert cfq to highres timers, since jiffies isn't granular enough
     for some devices these days.  From Jan and Jeff

   - CFQ priority boost fix idle classes, from me

   - cleanup series from Ming, improving our bio/bvec iteration

   - a direct issue fix for blk-mq from Omar

   - fix for plug merging not involving the IO scheduler, like we do for
     other types of merges.  From Tahsin

   - expose DAX type internally and through sysfs.  From Toshi and Yigal

* 'for-4.8/core' of git://git.kernel.dk/linux-block: (76 commits)
  block: Fix front merge check
  block: do not merge requests without consulting with io scheduler
  block: Fix spelling in a source code comment
  block: expose QUEUE_FLAG_DAX in sysfs
  block: add QUEUE_FLAG_DAX for devices to advertise their DAX support
  Btrfs: fix comparison in __btrfs_map_block()
  block: atari: Return early for unsupported sector size
  Doc: block: Fix a typo in queue-sysfs.txt
  cfq-iosched: Charge at least 1 jiffie instead of 1 ns
  cfq-iosched: Fix regression in bonnie++ rewrite performance
  cfq-iosched: Convert slice_resid from u64 to s64
  block: Convert fifo_time from ulong to u64
  blktrace: avoid using timespec
  block/blk-cgroup.c: Declare local symbols static
  block/bio-integrity.c: Add #include "blk.h"
  block/partition-generic.c: Remove a set-but-not-used variable
  block: bio: kill BIO_MAX_SIZE
  cfq-iosched: temporarily boost queue priority for idle classes
  block: drbd: avoid to use BIO_MAX_SIZE
  block: bio: remove BIO_MAX_SECTORS
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull core block updates from Jens Axboe:

   - the big change is the cleanup from Mike Christie, cleaning up our
     uses of command types and modified flags.  This is what will throw
     some merge conflicts

   - regression fix for the above for btrfs, from Vincent

   - following up to the above, better packing of struct request from
     Christoph

   - a 2038 fix for blktrace from Arnd

   - a few trivial/spelling fixes from Bart Van Assche

   - a front merge check fix from Damien, which could cause issues on
     SMR drives

   - Atari partition fix from Gabriel

   - convert cfq to highres timers, since jiffies isn't granular enough
     for some devices these days.  From Jan and Jeff

   - CFQ priority boost fix idle classes, from me

   - cleanup series from Ming, improving our bio/bvec iteration

   - a direct issue fix for blk-mq from Omar

   - fix for plug merging not involving the IO scheduler, like we do for
     other types of merges.  From Tahsin

   - expose DAX type internally and through sysfs.  From Toshi and Yigal

* 'for-4.8/core' of git://git.kernel.dk/linux-block: (76 commits)
  block: Fix front merge check
  block: do not merge requests without consulting with io scheduler
  block: Fix spelling in a source code comment
  block: expose QUEUE_FLAG_DAX in sysfs
  block: add QUEUE_FLAG_DAX for devices to advertise their DAX support
  Btrfs: fix comparison in __btrfs_map_block()
  block: atari: Return early for unsupported sector size
  Doc: block: Fix a typo in queue-sysfs.txt
  cfq-iosched: Charge at least 1 jiffie instead of 1 ns
  cfq-iosched: Fix regression in bonnie++ rewrite performance
  cfq-iosched: Convert slice_resid from u64 to s64
  block: Convert fifo_time from ulong to u64
  blktrace: avoid using timespec
  block/blk-cgroup.c: Declare local symbols static
  block/bio-integrity.c: Add #include "blk.h"
  block/partition-generic.c: Remove a set-but-not-used variable
  block: bio: kill BIO_MAX_SIZE
  cfq-iosched: temporarily boost queue priority for idle classes
  block: drbd: avoid to use BIO_MAX_SIZE
  block: bio: remove BIO_MAX_SECTORS
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: pass the nbd pointer for flags debugfs</title>
<updated>2016-06-08T15:03:54+00:00</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fb.com</email>
</author>
<published>2016-06-08T14:32:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d366a0ff1cf73f93796f2377e7b0361a94c41c35'/>
<id>d366a0ff1cf73f93796f2377e7b0361a94c41c35</id>
<content type='text'>
We were passing in &amp;nbd for the private data in debugfs_create_file() for the
flags entry.  We expect it to just be nbd, fix this so we get proper output from
this debugfs entry.

Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were passing in &amp;nbd for the private data in debugfs_create_file() for the
flags entry.  We expect it to just be nbd, fix this so we get proper output from
this debugfs entry.

Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block, drivers: add REQ_OP_FLUSH operation</title>
<updated>2016-06-07T19:41:38+00:00</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:32:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3a5e02ced11e22ecd9da3d6710afe15bcfee1d10'/>
<id>3a5e02ced11e22ecd9da3d6710afe15bcfee1d10</id>
<content type='text'>
This adds a REQ_OP_FLUSH operation that is sent to request_fn
based drivers by the block layer's flush code, instead of
sending requests with the request-&gt;cmd_flags REQ_FLUSH bit set.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a REQ_OP_FLUSH operation that is sent to request_fn
based drivers by the block layer's flush code, instead of
sending requests with the request-&gt;cmd_flags REQ_FLUSH bit set.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers: use req op accessor</title>
<updated>2016-06-07T19:41:38+00:00</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:32:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c2df40dfb8c015211ec55f4b1dd0587f875c7b34'/>
<id>c2df40dfb8c015211ec55f4b1dd0587f875c7b34</id>
<content type='text'>
The req operation REQ_OP is separated from the rq_flag_bits
definition. This converts the block layer drivers to
use req_op to get the op from the request struct.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The req operation REQ_OP is separated from the rq_flag_bits
definition. This converts the block layer drivers to
use req_op to get the op from the request struct.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: switch to using blk_queue_write_cache()</title>
<updated>2016-04-12T22:00:39+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2016-03-30T16:10:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=aafb1eecbb79ac135fa8028f961596333ecbb80b'/>
<id>aafb1eecbb79ac135fa8028f961596333ecbb80b</id>
<content type='text'>
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: use correct div_s64 helper</title>
<updated>2016-03-05T00:20:12+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-03-04T23:49:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5e454c67fc594150e6c0da32b388a43d40200759'/>
<id>5e454c67fc594150e6c0da32b388a43d40200759</id>
<content type='text'>
The do_div() macro now checks its arguments for the correct type,
and refuses anything other than u64, so we get a warning about
nbd_ioctl passing in an loff_t:

drivers/block/nbd.c: In function '__nbd_ioctl':
drivers/block/nbd.c:757:77: error: comparison of distinct pointer types lacks a cast [-Werror]

This changes the nbd code to use div_s64() instead, which takes
a signed argument.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 37091fdd831f ("nbd: Create size change events for userspace")
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The do_div() macro now checks its arguments for the correct type,
and refuses anything other than u64, so we get a warning about
nbd_ioctl passing in an loff_t:

drivers/block/nbd.c: In function '__nbd_ioctl':
drivers/block/nbd.c:757:77: error: comparison of distinct pointer types lacks a cast [-Werror]

This changes the nbd code to use div_s64() instead, which takes
a signed argument.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 37091fdd831f ("nbd: Create size change events for userspace")
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: Create size change events for userspace</title>
<updated>2016-02-15T09:35:47+00:00</updated>
<author>
<name>Markus Pargmann</name>
<email>mpa@pengutronix.de</email>
</author>
<published>2015-07-27T05:36:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=37091fdd831f28a6509008542174ed324dd645bc'/>
<id>37091fdd831f28a6509008542174ed324dd645bc</id>
<content type='text'>
The userspace needs to know when nbd devices are ready for use.
Currently no events are created for the userspace which doesn't work for
systemd.

See the discussion here: https://github.com/systemd/systemd/pull/358

This patch uses a central point to setup the nbd-internal sizes. A ioctl
to set a size does not lead to a visible size change. The size of the
block device will be kept at 0 until nbd is connected. As soon as it
connects, the size will be changed to the real value and a uevent is
created. When disconnecting, the blockdevice is set to 0 size and
another uevent is generated.

Signed-off-by: Markus Pargmann &lt;mpa@pengutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The userspace needs to know when nbd devices are ready for use.
Currently no events are created for the userspace which doesn't work for
systemd.

See the discussion here: https://github.com/systemd/systemd/pull/358

This patch uses a central point to setup the nbd-internal sizes. A ioctl
to set a size does not lead to a visible size change. The size of the
block device will be kept at 0 until nbd is connected. As soon as it
connects, the size will be changed to the real value and a uevent is
created. When disconnecting, the blockdevice is set to 0 size and
another uevent is generated.

Signed-off-by: Markus Pargmann &lt;mpa@pengutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: ratelimit error msgs after socket close</title>
<updated>2016-02-05T07:55:15+00:00</updated>
<author>
<name>Dan Streetman</name>
<email>dan.streetman@canonical.com</email>
</author>
<published>2016-01-14T18:42:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=da6ccaaa79caca4f38b540b651238f87215217a2'/>
<id>da6ccaaa79caca4f38b540b651238f87215217a2</id>
<content type='text'>
Make the "Attempted send on closed socket" error messages generated in
nbd_request_handler() ratelimited.

When the nbd socket is shutdown, the nbd_request_handler() function emits
an error message for every request remaining in its queue.  If the queue
is large, this will spam a large amount of messages to the log.  There's
no need for a separate error message for each request, so this patch
ratelimits it.

In the specific case this was found, the system was virtual and the error
messages were logged to the serial port, which overwhelmed it.

Fixes: 4d48a542b427 ("nbd: fix I/O hang on disconnected nbds")
Signed-off-by: Dan Streetman &lt;dan.streetman@canonical.com&gt;
Signed-off-by: Markus Pargmann &lt;mpa@pengutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the "Attempted send on closed socket" error messages generated in
nbd_request_handler() ratelimited.

When the nbd socket is shutdown, the nbd_request_handler() function emits
an error message for every request remaining in its queue.  If the queue
is large, this will spam a large amount of messages to the log.  There's
no need for a separate error message for each request, so this patch
ratelimits it.

In the specific case this was found, the system was virtual and the error
messages were logged to the serial port, which overwhelmed it.

Fixes: 4d48a542b427 ("nbd: fix I/O hang on disconnected nbds")
Signed-off-by: Dan Streetman &lt;dan.streetman@canonical.com&gt;
Signed-off-by: Markus Pargmann &lt;mpa@pengutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nbd: Move flag parsing to a function</title>
<updated>2016-02-05T07:52:33+00:00</updated>
<author>
<name>Markus Pargmann</name>
<email>mpa@pengutronix.de</email>
</author>
<published>2015-10-29T11:06:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d02cf53107792df373558851d6162dc4e4ceb95a'/>
<id>d02cf53107792df373558851d6162dc4e4ceb95a</id>
<content type='text'>
nbd changes properties of the blockdevice depending on flags that were
received. This patch moves this flag parsing into a separate function
nbd_parse_flags().

Signed-off-by: Markus Pargmann &lt;mpa@pengutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
nbd changes properties of the blockdevice depending on flags that were
received. This patch moves this flag parsing into a separate function
nbd_parse_flags().

Signed-off-by: Markus Pargmann &lt;mpa@pengutronix.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
