diff options
author | Jens Axboe <axboe@fb.com> | 2016-08-08 13:42:42 (GMT) |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-08-08 13:42:42 (GMT) |
commit | d3f422c8d58b2f0d68a51db88389a715dc10b4d2 (patch) | |
tree | 128fe3046bdb500af63a38d5ed407add7c969e76 /drivers/nvme/target/core.c | |
parent | 29b4817d4018df78086157ea3a55c1d9424a7cfc (diff) | |
parent | e3266378bdbca82c2854fc612fa9a391eba1f173 (diff) | |
download | linux-d3f422c8d58b2f0d68a51db88389a715dc10b4d2.tar.xz |
Merge branch 'nvmf-4.8-rc' of git://git.infradead.org/nvme-fabrics into for-linus
Sagi writes:
Mostly stability fixes for nvmet, rdma:
- fix uninitialized rdma_cm private data from Roland.
- rdma device removal handling (host and target).
- fix controller disconnect during active mounts.
- fix namespaces lost after fabric reconnects.
- remove redundant calls to namespace removal (rdma, loop).
- actually send controller shutdown when disconnecting.
- reconnect fixes (ns rescan and aen requeue)
- nvmet controller serial number inconsistency fix.
Diffstat (limited to 'drivers/nvme/target/core.c')
-rw-r--r-- | drivers/nvme/target/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 8a891ca..6559d5a 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -13,6 +13,7 @@ */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> +#include <linux/random.h> #include "nvmet.h" static struct nvmet_fabrics_ops *nvmet_transports[NVMF_TRTYPE_MAX]; @@ -728,6 +729,9 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn, memcpy(ctrl->subsysnqn, subsysnqn, NVMF_NQN_SIZE); memcpy(ctrl->hostnqn, hostnqn, NVMF_NQN_SIZE); + /* generate a random serial number as our controllers are ephemeral: */ + get_random_bytes(&ctrl->serial, sizeof(ctrl->serial)); + kref_init(&ctrl->ref); ctrl->subsys = subsys; |