diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
commit | 0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch) | |
tree | 41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /drivers/nvme/target/core.c | |
parent | aa877175e7a9982233ed8f10cb4bfddd78d82741 (diff) | |
parent | 3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff) |
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
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 8a891ca53367..6559d5afa7bf 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c | |||
@@ -13,6 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/random.h> | ||
16 | #include "nvmet.h" | 17 | #include "nvmet.h" |
17 | 18 | ||
18 | static struct nvmet_fabrics_ops *nvmet_transports[NVMF_TRTYPE_MAX]; | 19 | static struct nvmet_fabrics_ops *nvmet_transports[NVMF_TRTYPE_MAX]; |
@@ -728,6 +729,9 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn, | |||
728 | memcpy(ctrl->subsysnqn, subsysnqn, NVMF_NQN_SIZE); | 729 | memcpy(ctrl->subsysnqn, subsysnqn, NVMF_NQN_SIZE); |
729 | memcpy(ctrl->hostnqn, hostnqn, NVMF_NQN_SIZE); | 730 | memcpy(ctrl->hostnqn, hostnqn, NVMF_NQN_SIZE); |
730 | 731 | ||
732 | /* generate a random serial number as our controllers are ephemeral: */ | ||
733 | get_random_bytes(&ctrl->serial, sizeof(ctrl->serial)); | ||
734 | |||
731 | kref_init(&ctrl->ref); | 735 | kref_init(&ctrl->ref); |
732 | ctrl->subsys = subsys; | 736 | ctrl->subsys = subsys; |
733 | 737 | ||