diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-20 14:51:56 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-20 14:51:56 +0300 |
commit | ff6ccad361df4dfda42b60897cb7e55b3ba13439 (patch) | |
tree | 69ddf7ec947d47409291a01d54827ce0384c598b /drivers/block/nbd.c | |
parent | 3bd30b24efa6b3339e4344a7db39e594f06d5128 (diff) | |
parent | 41f1830f5a7af77cf5c86359aba3cbd706687e52 (diff) | |
download | linux-ff6ccad361df4dfda42b60897cb7e55b3ba13439.tar.xz |
Merge tag 'v4.12-rc6' into patchwork
Linux 4.12-rc6
* tag 'v4.12-rc6': (813 commits)
Linux 4.12-rc6
mm: larger stack guard gap, between vmas
virtio_balloon: disable VIOMMU support
mm: correct the comment when reclaimed pages exceed the scanned pages
userfaultfd: shmem: handle coredumping in handle_userfault()
mm: numa: avoid waiting on freed migrated pages
swap: cond_resched in swap_cgroup_prepare()
mm/memory-failure.c: use compound_head() flags for huge pages
perf unwind: Report module before querying isactivation in dwfl unwind
fs: pass on flags in compat_writev
objtool: Add fortify_panic as __noreturn function
powerpc/debug: Add missing warn flag to WARN_ON's non-builtin path
USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks
drm: mxsfb_crtc: Reset the eLCDIF controller
drm/mgag200: Fix to always set HiPri for G200e4 V2
i2c: ismt: fix wrong device address when unmap the data buffer
i2c: rcar: use correct length when unmapping DMA
powerpc/xive: Fix offset for store EOI MMIOs
drm/tegra: Correct idr_alloc() minimum id
drm/tegra: Fix lockup on a use of staging API
...
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/block/nbd.c')
-rw-r--r-- | drivers/block/nbd.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 9a7bb2c29447..f3f191ba8ca4 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -937,14 +937,6 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg) return -ENOSPC; } -/* Reset all properties of an NBD device */ -static void nbd_reset(struct nbd_device *nbd) -{ - nbd->config = NULL; - nbd->tag_set.timeout = 0; - queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); -} - static void nbd_bdev_reset(struct block_device *bdev) { if (bdev->bd_openers > 1) @@ -1029,7 +1021,11 @@ static void nbd_config_put(struct nbd_device *nbd) } kfree(config->socks); } - nbd_reset(nbd); + kfree(nbd->config); + nbd->config = NULL; + + nbd->tag_set.timeout = 0; + queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue); mutex_unlock(&nbd->config_lock); nbd_put(nbd); @@ -1483,7 +1479,6 @@ static int nbd_dev_add(int index) disk->fops = &nbd_fops; disk->private_data = nbd; sprintf(disk->disk_name, "nbd%d", index); - nbd_reset(nbd); add_disk(disk); nbd_total_devices++; return index; |