linux-stable/drivers/block
Mike Christie 0b584bf573 nbd: fix max number of supported devs
[ Upstream commit e9e006f5fc ]

This fixes a bug added in 4.10 with commit:

commit 9561a7ade0
Author: Josef Bacik <jbacik@fb.com>
Date:   Tue Nov 22 14:04:40 2016 -0500

    nbd: add multi-connection support

that limited the number of devices to 256. Before the patch we could
create 1000s of devices, but the patch switched us from using our
own thread to using a work queue which has a default limit of 256
active works.

The problem is that our recv_work function sits in a loop until
disconnection but only handles IO for one connection. The work is
started when the connection is started/restarted, but if we end up
creating 257 or more connections, the queue_work call just queues
connection257+'s recv_work and that waits for connection 1 - 256's
recv_work to be disconnected and that work instance completing.

Instead of reverting back to kthreads, this has us allocate a
workqueue_struct per device, so we can block in the work.

Cc: stable@vger.kernel.org
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-10-11 18:18:44 +02:00
..
aoe
drbd drbd: dynamically allocate shash descriptor 2019-08-16 10:13:53 +02:00
mtip32xx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
paride cdrom: do not call check_disk_change() inside cdrom_open() 2018-05-30 07:52:34 +02:00
rsxx block: pass in queue to inflight accounting 2017-08-09 13:09:16 -06:00
xen-blkback xen/blkback: fix memory leaks 2019-09-06 10:20:44 +02:00
zram zram: pass down the bvec we need to read into in the work struct 2019-05-02 09:40:28 +02:00
amiflop.c
ataflop.c ataflop: fix error handling during setup 2018-11-13 11:14:51 -08:00
brd.c brd: fix overflow in __brd_direct_access 2017-09-25 08:56:05 -06:00
cryptoloop.c
DAC960.c block: DAC960: shut up format-overflow warning 2017-07-29 09:00:03 -06:00
DAC960.h
floppy.c floppy: fix usercopy direction 2019-09-21 07:15:46 +02:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
loop.c loop: set PF_MEMALLOC_NOIO for the worker thread 2019-08-16 10:13:46 +02:00
loop.h Revert "block/loop: Use global lock for ioctl() operation." 2019-05-02 09:40:33 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nbd.c nbd: fix max number of supported devs 2019-10-11 18:18:44 +02:00
null_blk.c block: null_blk: fix 'Invalid parameters' when loading module 2018-05-30 07:52:36 +02:00
pktcdvd.c pktcdvd: remove warning on attempting to register non-passthrough dev 2019-10-07 18:55:13 +02:00
ps3disk.c
ps3vram.c block/ps3vram: Check return of ps3vram_cache_init 2017-08-17 23:03:44 +10:00
rbd.c rbd: don't return 0 on unmap if RBD_DEV_FLAG_REMOVING is set 2019-01-16 22:07:12 +01:00
rbd_types.h
skd_main.c skd: Use kmem_cache_free 2017-10-09 08:31:27 -06:00
skd_s1120.h skd: Use __packed only when needed 2017-08-18 08:45:29 -06:00
smart1,2.h
sunvdc.c sunvdc: Do not spin in an infinite loop when vio_ldc_send() returns EAGAIN 2019-02-12 19:46:00 +01:00
swim.c swim: fix cleanup on setup error 2018-11-13 11:14:52 -08:00
swim3.c block/swim3: Fix -EBUSY error when re-opening device after unmount 2019-02-12 19:46:09 +01:00
swim_asm.S
sx8.c
umem.c
umem.h
virtio_blk.c virtio-blk: limit number of hw queues by nr_cpu_ids 2019-05-10 17:53:12 +02:00
xen-blkfront.c xen-blkfront: fix kernel panic with negotiate_mq error path 2018-11-13 11:15:11 -08:00
xsysace.c xsysace: Fix error handling in ace_setup 2019-05-08 07:20:51 +02:00
z2ram.c